diff --git a/compiler/cli/src/org/jetbrains/kotlin/cli/common/messages/AnalyzerWithCompilerReport.java b/compiler/cli/src/org/jetbrains/kotlin/cli/common/messages/AnalyzerWithCompilerReport.java index 469aafca0a3..7b257bafddd 100644 --- a/compiler/cli/src/org/jetbrains/kotlin/cli/common/messages/AnalyzerWithCompilerReport.java +++ b/compiler/cli/src/org/jetbrains/kotlin/cli/common/messages/AnalyzerWithCompilerReport.java @@ -40,6 +40,7 @@ import org.jetbrains.kotlin.resolve.DescriptorToSourceUtils; import org.jetbrains.kotlin.resolve.DescriptorUtils; import org.jetbrains.kotlin.resolve.diagnostics.Diagnostics; import org.jetbrains.kotlin.resolve.jvm.JvmClassName; +import org.jetbrains.kotlin.utils.UtilsPackage; import java.util.Collection; import java.util.List; @@ -97,13 +98,16 @@ public final class AnalyzerWithCompilerReport { BindingContext bindingContext = analysisResult.getBindingContext(); Collection classes = bindingContext.getKeys(TraceBasedErrorReporter.INCOMPLETE_HIERARCHY); if (!classes.isEmpty()) { - StringBuilder message = new StringBuilder("The following classes have incomplete hierarchies:\n"); + StringBuilder message = new StringBuilder("Supertypes of the following classes cannot be resolved. " + + "Please make sure you have the required dependencies in the classpath:\n"); for (ClassDescriptor descriptor : classes) { String fqName = DescriptorUtils.getFqName(descriptor).asString(); List unresolved = bindingContext.get(TraceBasedErrorReporter.INCOMPLETE_HIERARCHY, descriptor); assert unresolved != null && !unresolved.isEmpty() : "Incomplete hierarchy should be reported with names of unresolved superclasses: " + fqName; - message.append(" ").append(fqName).append(", unresolved: ").append(unresolved).append("\n"); + message.append(" class ").append(fqName) + .append(", unresolved supertypes: ").append(UtilsPackage.join(unresolved, ", ")) + .append("\n"); } messageCollector.report(CompilerMessageSeverity.ERROR, message.toString(), CompilerMessageLocation.NO_LOCATION); } diff --git a/compiler/testData/compileKotlinAgainstCustomBinaries/incompleteHierarchyInJava/output.txt b/compiler/testData/compileKotlinAgainstCustomBinaries/incompleteHierarchyInJava/output.txt index 8b8aad8876e..c5f7f55f850 100644 --- a/compiler/testData/compileKotlinAgainstCustomBinaries/incompleteHierarchyInJava/output.txt +++ b/compiler/testData/compileKotlinAgainstCustomBinaries/incompleteHierarchyInJava/output.txt @@ -1,7 +1,7 @@ -error: the following classes have incomplete hierarchies: - test.Sub, unresolved: [Super] +error: supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath: + class test.Sub, unresolved supertypes: Super compiler/testData/compileKotlinAgainstCustomBinaries/incompleteHierarchyInJava/source.kt:5:22: error: unresolved reference: foo fun bar() = SubSub().foo() ^ -COMPILATION_ERROR \ No newline at end of file +COMPILATION_ERROR