diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/PlatformIncompatibilityDiagnosticRenderer.kt b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/PlatformIncompatibilityDiagnosticRenderer.kt index 86465e1f622..af3e01b77ed 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/PlatformIncompatibilityDiagnosticRenderer.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/PlatformIncompatibilityDiagnosticRenderer.kt @@ -48,10 +48,14 @@ object PlatformIncompatibilityDiagnosticRenderer : append("The following declaration") if (descriptors.size == 1) append(" is") else append("s are") append(" incompatible") - incompatibility.reason?.let { append(" because $it") } + incompatibility.reason?.let { appendln(" because $it:") } + + for (descriptor in descriptors) { + append(indent + " ") + appendln(renderDescriptor(descriptor)) + } incompatibility.unimplemented?.let { unimplemented -> - appendln(".") append(indent) appendln("No implementations are found for members listed below:") for ((descriptor, mapping) in unimplemented) { @@ -63,12 +67,6 @@ object PlatformIncompatibilityDiagnosticRenderer : } render(mapping, indent + INDENTATION_UNIT, renderDescriptor) } - } ?: run { - appendln(":") - for (descriptor in descriptors) { - append(indent + " ") - appendln(renderDescriptor(descriptor)) - } } } } diff --git a/compiler/testData/multiplatform/classScopes/constructorIncorrectSignature/output.txt b/compiler/testData/multiplatform/classScopes/constructorIncorrectSignature/output.txt index 42e26a48355..ee080f04ec7 100644 --- a/compiler/testData/multiplatform/classScopes/constructorIncorrectSignature/output.txt +++ b/compiler/testData/multiplatform/classScopes/constructorIncorrectSignature/output.txt @@ -6,7 +6,8 @@ Output: Exit code: COMPILATION_ERROR Output: compiler/testData/multiplatform/classScopes/constructorIncorrectSignature/common.kt:1:14: error: header declaration 'Foo' has no implementation in module -The following declaration is incompatible because some members are not implemented. +The following declaration is incompatible because some members are not implemented: + public final impl class Foo No implementations are found for members listed below: public constructor Foo(s: String) @@ -22,4 +23,3 @@ impl class Foo { compiler/testData/multiplatform/classScopes/constructorIncorrectSignature/jvm.kt:2:5: error: modifier 'impl' is only applicable to members that are initially declared in platform-independent code impl constructor(s: Array) ^ - diff --git a/compiler/testData/multiplatform/classScopes/functionIncorrectSignature/output.txt b/compiler/testData/multiplatform/classScopes/functionIncorrectSignature/output.txt index 0edce5e9253..6ed91c26328 100644 --- a/compiler/testData/multiplatform/classScopes/functionIncorrectSignature/output.txt +++ b/compiler/testData/multiplatform/classScopes/functionIncorrectSignature/output.txt @@ -6,7 +6,8 @@ Output: Exit code: COMPILATION_ERROR Output: compiler/testData/multiplatform/classScopes/functionIncorrectSignature/common.kt:1:14: error: header declaration 'Foo' has no implementation in module -The following declaration is incompatible because some members are not implemented. +The following declaration is incompatible because some members are not implemented: + public final impl class Foo No implementations are found for members listed below: public final header fun function(b: ByteArray): Int @@ -22,4 +23,3 @@ impl class Foo { compiler/testData/multiplatform/classScopes/functionIncorrectSignature/jvm.kt:2:5: error: modifier 'impl' is only applicable to members that are initially declared in platform-independent code impl fun function(b: ByteArray): Long = b.size.toLong() ^ - diff --git a/compiler/testData/multiplatform/classScopes/missingConstructor/output.txt b/compiler/testData/multiplatform/classScopes/missingConstructor/output.txt index 03fe405db08..ad11152dd33 100644 --- a/compiler/testData/multiplatform/classScopes/missingConstructor/output.txt +++ b/compiler/testData/multiplatform/classScopes/missingConstructor/output.txt @@ -6,7 +6,8 @@ Output: Exit code: COMPILATION_ERROR Output: compiler/testData/multiplatform/classScopes/missingConstructor/common.kt:1:14: error: header declaration 'Foo' has no implementation in module -The following declaration is incompatible because some members are not implemented. +The following declaration is incompatible because some members are not implemented: + public final impl class Foo No implementations are found for members listed below: public constructor Foo(s: String) @@ -19,4 +20,3 @@ header class Foo { compiler/testData/multiplatform/classScopes/missingConstructor/jvm.kt:1:1: error: modifier 'impl' is only applicable to members that are initially declared in platform-independent code impl class Foo ^ - diff --git a/compiler/testData/multiplatform/classScopes/missingFunction/output.txt b/compiler/testData/multiplatform/classScopes/missingFunction/output.txt index 0a32c052ed7..914232e9657 100644 --- a/compiler/testData/multiplatform/classScopes/missingFunction/output.txt +++ b/compiler/testData/multiplatform/classScopes/missingFunction/output.txt @@ -6,7 +6,8 @@ Output: Exit code: COMPILATION_ERROR Output: compiler/testData/multiplatform/classScopes/missingFunction/common.kt:1:14: error: header declaration 'Foo' has no implementation in module -The following declaration is incompatible because some members are not implemented. +The following declaration is incompatible because some members are not implemented: + public final impl class Foo No implementations are found for members listed below: public final header fun function(s: String): Unit @@ -16,4 +17,3 @@ header class Foo { compiler/testData/multiplatform/classScopes/missingFunction/jvm.kt:1:1: error: modifier 'impl' is only applicable to members that are initially declared in platform-independent code impl class Foo ^ -