From c8cbe057223bacea0f40de41c320a0bb76e7216c Mon Sep 17 00:00:00 2001 From: Dmitry Savvinov Date: Fri, 16 Nov 2018 14:43:23 +0300 Subject: [PATCH] [Minor] Add even more logging for EA-119635 --- .../jetbrains/kotlin/types/CommonSupertypes.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/compiler/frontend/src/org/jetbrains/kotlin/types/CommonSupertypes.java b/compiler/frontend/src/org/jetbrains/kotlin/types/CommonSupertypes.java index 8d783dd2707..5f9c35cd9e0 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/types/CommonSupertypes.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/types/CommonSupertypes.java @@ -9,11 +9,10 @@ import kotlin.collections.CollectionsKt; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.kotlin.builtins.KotlinBuiltIns; -import org.jetbrains.kotlin.descriptors.ClassDescriptor; -import org.jetbrains.kotlin.descriptors.ClassifierDescriptor; -import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor; +import org.jetbrains.kotlin.descriptors.*; import org.jetbrains.kotlin.descriptors.annotations.Annotations; import org.jetbrains.kotlin.renderer.DescriptorRenderer; +import org.jetbrains.kotlin.resolve.DescriptorUtils; import org.jetbrains.kotlin.resolve.scopes.MemberScope; import org.jetbrains.kotlin.types.typeUtil.TypeUtilsKt; import org.jetbrains.kotlin.utils.DFS; @@ -153,7 +152,7 @@ public class CommonSupertypes { .append("- DeclarationDescriptor class: ").append(classOfDeclarationDescriptor(type)).append('\n') .append('\n'); } - throw new IllegalStateException("There is no common supertype for: " + types + " \n" + info.toString()); + throw new IllegalStateException("[Report version 3] There is no common supertype for: " + types + " \n" + info.toString()); } // constructor of the supertype -> all of its instantiations occurring as supertypes @@ -177,7 +176,13 @@ public class CommonSupertypes { } AbstractTypeConstructor abstractTypeConstructor = (AbstractTypeConstructor) typeConstructor; - return abstractTypeConstructor.renderAdditionalDebugInformation(); + DeclarationDescriptor declarationDescriptor = abstractTypeConstructor.getDeclarationDescriptor(); + String moduleDescriptorString = declarationDescriptor == null + ? "" + : Objects.toString(DescriptorUtils.getContainingModule(declarationDescriptor)); + return "descriptor=" + declarationDescriptor + "@" + Integer.toHexString(Objects.hashCode(declarationDescriptor)) + + ", moduleDescriptor=" + moduleDescriptorString + + ", " + abstractTypeConstructor.renderAdditionalDebugInformation(); } @Nullable