Migration to expect/actual: change diagnostics rendering
This commit is contained in:
committed by
Stanislav Erokhin
parent
7982f3489e
commit
a18e9436a1
+15
-15
@@ -195,7 +195,7 @@ public class DefaultErrorMessages {
|
||||
case INVOKE_ON_FUNCTION_TYPE:
|
||||
return "function types";
|
||||
case EXPECTED_CLASS_MEMBER:
|
||||
return "members of header classes";
|
||||
return "members of expected classes";
|
||||
default:
|
||||
throw new AssertionError(target);
|
||||
}
|
||||
@@ -262,26 +262,26 @@ public class DefaultErrorMessages {
|
||||
MAP.put(MULTIPLE_VARARG_PARAMETERS, "Multiple vararg-parameters are prohibited");
|
||||
MAP.put(FORBIDDEN_VARARG_PARAMETER_TYPE, "Forbidden vararg parameter type: {0}", RENDER_TYPE);
|
||||
|
||||
MAP.put(EXPECTED_DECLARATION_WITH_BODY, "Header declaration must not have a body");
|
||||
MAP.put(EXPECTED_DECLARATION_WITH_DEFAULT_PARAMETER, "Header declaration cannot have parameters with default values");
|
||||
MAP.put(EXPECTED_CLASS_CONSTRUCTOR_DELEGATION_CALL, "Explicit delegation call for constructor of a header class is not allowed");
|
||||
MAP.put(EXPECTED_CLASS_CONSTRUCTOR_PROPERTY_PARAMETER, "Header class constructor cannot have a property parameter");
|
||||
MAP.put(EXPECTED_ENUM_CONSTRUCTOR, "Header enum class cannot have a constructor");
|
||||
MAP.put(EXPECTED_ENUM_ENTRY_WITH_BODY, "Header enum entry cannot have a body");
|
||||
MAP.put(EXPECTED_PROPERTY_INITIALIZER, "Header property cannot have an initializer");
|
||||
MAP.put(EXPECTED_DECLARATION_WITH_BODY, "Expected declaration must not have a body");
|
||||
MAP.put(EXPECTED_DECLARATION_WITH_DEFAULT_PARAMETER, "Expected declaration cannot have parameters with default values");
|
||||
MAP.put(EXPECTED_CLASS_CONSTRUCTOR_DELEGATION_CALL, "Explicit delegation call for constructor of an expected class is not allowed");
|
||||
MAP.put(EXPECTED_CLASS_CONSTRUCTOR_PROPERTY_PARAMETER, "Expected class constructor cannot have a property parameter");
|
||||
MAP.put(EXPECTED_ENUM_CONSTRUCTOR, "Expected enum class cannot have a constructor");
|
||||
MAP.put(EXPECTED_ENUM_ENTRY_WITH_BODY, "Expected enum entry cannot have a body");
|
||||
MAP.put(EXPECTED_PROPERTY_INITIALIZER, "Expected property cannot have an initializer");
|
||||
|
||||
MAP.put(ACTUAL_TYPE_ALIAS_NOT_TO_CLASS, "Right-hand side of 'impl' type alias should be a class, not another type alias");
|
||||
MAP.put(ACTUAL_TYPE_ALIAS_NOT_TO_CLASS, "Right-hand side of actual type alias should be a class, not another type alias");
|
||||
MAP.put(ACTUAL_TYPE_ALIAS_TO_CLASS_WITH_DECLARATION_SITE_VARIANCE, "Aliased class should not have type parameters with declaration-site variance");
|
||||
MAP.put(ACTUAL_TYPE_ALIAS_WITH_USE_SITE_VARIANCE, "Right-hand side of 'impl' type alias cannot contain use-site variance or star projections");
|
||||
MAP.put(ACTUAL_TYPE_ALIAS_WITH_COMPLEX_SUBSTITUTION, "Type arguments in the right-hand side of 'impl' type alias should be its type parameters in the same order, e.g. 'impl typealias Foo<A, B> = Bar<A, B>'");
|
||||
MAP.put(ACTUAL_TYPE_ALIAS_WITH_USE_SITE_VARIANCE, "Right-hand side of actual type alias cannot contain use-site variance or star projections");
|
||||
MAP.put(ACTUAL_TYPE_ALIAS_WITH_COMPLEX_SUBSTITUTION, "Type arguments in the right-hand side of actual type alias should be its type parameters in the same order, e.g. 'impl typealias Foo<A, B> = Bar<A, B>'");
|
||||
|
||||
MAP.put(NO_ACTUAL_FOR_EXPECT, "''header'' {0} has no implementation in module{1}{2}", DECLARATION_NAME_WITH_KIND,
|
||||
MAP.put(NO_ACTUAL_FOR_EXPECT, "Expected {0} has no actual in module{1}{2}", DECLARATION_NAME_WITH_KIND,
|
||||
PLATFORM, PlatformIncompatibilityDiagnosticRenderer.TEXT);
|
||||
MAP.put(ACTUAL_WITHOUT_EXPECT, "''impl'' {0} has no corresponding ''header'' declaration{1}", DECLARATION_NAME_WITH_KIND,
|
||||
MAP.put(ACTUAL_WITHOUT_EXPECT, "Actual {0} has no corresponding expected declaration{1}", DECLARATION_NAME_WITH_KIND,
|
||||
PlatformIncompatibilityDiagnosticRenderer.TEXT);
|
||||
|
||||
MAP.put(NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS, "''impl'' class ''{0}'' has no implementation of ''header'' class members:{1}",
|
||||
NAME, IncompatibleHeaderImplClassScopesRenderer.TEXT);
|
||||
MAP.put(NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS, "In class ''{0}'' expected members have no actual ones:{1}",
|
||||
NAME, IncompatibleExpectedActualClassScopesRenderer.TEXT);
|
||||
MAP.put(ACTUAL_MISSING, "Declaration should be marked with 'actual' (suppress with -Xno-check-actual)");
|
||||
|
||||
MAP.put(PROJECTION_ON_NON_CLASS_TYPE_ARGUMENT, "Projections are not allowed on type arguments of functions and properties");
|
||||
|
||||
+7
-7
@@ -41,7 +41,7 @@ class PlatformIncompatibilityDiagnosticRenderer(
|
||||
}
|
||||
}
|
||||
|
||||
class IncompatibleHeaderImplClassScopesRenderer(
|
||||
class IncompatibleExpectedActualClassScopesRenderer(
|
||||
private val mode: MultiplatformDiagnosticRenderingMode
|
||||
) : DiagnosticParameterRenderer<List<Pair<MemberDescriptor, Map<Incompatible, Collection<MemberDescriptor>>>>> {
|
||||
override fun render(
|
||||
@@ -58,7 +58,7 @@ class IncompatibleHeaderImplClassScopesRenderer(
|
||||
|
||||
companion object {
|
||||
@JvmField
|
||||
val TEXT = IncompatibleHeaderImplClassScopesRenderer(MultiplatformDiagnosticRenderingMode())
|
||||
val TEXT = IncompatibleExpectedActualClassScopesRenderer(MultiplatformDiagnosticRenderingMode())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ private fun StringBuilder.renderIncompatibilityInformation(
|
||||
|
||||
if (incompatibility is Incompatible.ClassScopes) {
|
||||
append(indent)
|
||||
append("No implementations are found for members listed below:")
|
||||
append("No actuals are found for expected members listed below:")
|
||||
mode.newLine(this)
|
||||
renderIncompatibleClassScopes(incompatibility.unfulfilled, indent, context, mode)
|
||||
}
|
||||
@@ -109,20 +109,20 @@ private fun StringBuilder.renderIncompatibilityInformation(
|
||||
}
|
||||
|
||||
private fun StringBuilder.renderIncompatibleClassScopes(
|
||||
unimplemented: List<Pair<MemberDescriptor, Map<Incompatible, Collection<MemberDescriptor>>>>,
|
||||
unfulfilled: List<Pair<MemberDescriptor, Map<Incompatible, Collection<MemberDescriptor>>>>,
|
||||
indent: String,
|
||||
context: RenderingContext,
|
||||
mode: MultiplatformDiagnosticRenderingMode
|
||||
) {
|
||||
mode.renderList(this, unimplemented.indices.map { index ->
|
||||
mode.renderList(this, unfulfilled.indices.map { index ->
|
||||
{
|
||||
val (descriptor, mapping) = unimplemented[index]
|
||||
val (descriptor, mapping) = unfulfilled[index]
|
||||
mode.renderDescriptor(this, descriptor, context, indent)
|
||||
if (mapping.isNotEmpty()) {
|
||||
mode.newLine(this)
|
||||
renderIncompatibilityInformation(mapping, indent + INDENTATION_UNIT, context, mode)
|
||||
}
|
||||
if (index != unimplemented.lastIndex) {
|
||||
if (index != unfulfilled.lastIndex) {
|
||||
mode.newLine(this)
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ Output:
|
||||
-- JVM --
|
||||
Exit code: COMPILATION_ERROR
|
||||
Output:
|
||||
compiler/testData/multiplatform/classScopes/constructorIncorrectSignature/jvm.kt:2:12: error: 'impl' constructor of 'Foo' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/classScopes/constructorIncorrectSignature/jvm.kt:2:12: error: actual constructor of 'Foo' has no corresponding expected declaration
|
||||
The following declaration is incompatible because parameter types are different:
|
||||
public constructor Foo(s: String)
|
||||
|
||||
|
||||
+2
-2
@@ -5,13 +5,13 @@ Output:
|
||||
-- JVM --
|
||||
Exit code: COMPILATION_ERROR
|
||||
Output:
|
||||
compiler/testData/multiplatform/classScopes/enumsWithDifferentEntries/jvm.kt:1:19: error: 'impl' enum class 'AB' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/classScopes/enumsWithDifferentEntries/jvm.kt:1:19: error: actual enum class 'AB' has no corresponding expected declaration
|
||||
The following declaration is incompatible because some entries from expected enum are missing in the actual enum:
|
||||
public final expect enum class AB : Enum<AB>
|
||||
|
||||
actual enum class AB { A, C }
|
||||
^
|
||||
compiler/testData/multiplatform/classScopes/enumsWithDifferentEntries/jvm.kt:3:19: error: 'impl' enum class 'CD' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/classScopes/enumsWithDifferentEntries/jvm.kt:3:19: error: actual enum class 'CD' has no corresponding expected declaration
|
||||
The following declaration is incompatible because some entries from expected enum are missing in the actual enum:
|
||||
public final expect enum class CD : Enum<CD>
|
||||
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ Output:
|
||||
-- JVM --
|
||||
Exit code: COMPILATION_ERROR
|
||||
Output:
|
||||
compiler/testData/multiplatform/classScopes/functionIncorrectSignature/jvm.kt:2:5: error: 'impl' function 'function' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/classScopes/functionIncorrectSignature/jvm.kt:2:5: error: actual function 'function' has no corresponding expected declaration
|
||||
The following declaration is incompatible because return type is different:
|
||||
public final expect fun function(b: ByteArray): Int
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -5,7 +5,7 @@ Output:
|
||||
-- JVM --
|
||||
Exit code: COMPILATION_ERROR
|
||||
Output:
|
||||
compiler/testData/multiplatform/classScopes/functionIncorrectSignatureFromSuperclass/jvm.kt:5:14: error: 'impl' class 'Foo' has no implementation of 'header' class members:
|
||||
compiler/testData/multiplatform/classScopes/functionIncorrectSignatureFromSuperclass/jvm.kt:5:14: error: in class 'Foo' expected members have no actual ones:
|
||||
|
||||
public final expect fun function(b: ByteArray): Int
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ Output:
|
||||
-- JVM --
|
||||
Exit code: COMPILATION_ERROR
|
||||
Output:
|
||||
compiler/testData/multiplatform/classScopes/missingConstructor/jvm.kt:1:14: error: 'impl' class 'Foo' has no implementation of 'header' class members:
|
||||
compiler/testData/multiplatform/classScopes/missingConstructor/jvm.kt:1:14: error: in class 'Foo' expected members have no actual ones:
|
||||
|
||||
public constructor Foo(s: String)
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ Output:
|
||||
-- JVM --
|
||||
Exit code: COMPILATION_ERROR
|
||||
Output:
|
||||
compiler/testData/multiplatform/classScopes/missingFunction/jvm.kt:1:14: error: 'impl' class 'Foo' has no implementation of 'header' class members:
|
||||
compiler/testData/multiplatform/classScopes/missingFunction/jvm.kt:1:14: error: in class 'Foo' expected members have no actual ones:
|
||||
|
||||
public final expect fun function(s: String): Unit
|
||||
|
||||
|
||||
@@ -8,115 +8,115 @@ expect fun f21(c: suspend Unit.() -> Unit)
|
||||
-- JVM --
|
||||
Exit code: COMPILATION_ERROR
|
||||
Output:
|
||||
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:1:1: error: 'impl' function 'f1' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:1:1: error: actual function 'f1' has no corresponding expected declaration
|
||||
The following declaration is incompatible because return type is different:
|
||||
public expect fun f1(): Unit
|
||||
|
||||
actual fun f1(): String = ""
|
||||
^
|
||||
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:3:1: error: 'impl' function 'f2' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:3:1: error: actual function 'f2' has no corresponding expected declaration
|
||||
The following declaration is incompatible because parameter names are different:
|
||||
public expect fun f2(name: String): Unit
|
||||
|
||||
actual fun f2(otherName: String) {}
|
||||
^
|
||||
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:5:1: error: 'impl' function 'f3' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:5:1: error: actual function 'f3' has no corresponding expected declaration
|
||||
The following declaration is incompatible because parameter types are different:
|
||||
public expect fun f3(name: String): Unit
|
||||
|
||||
actual fun f3(name: Double) {}
|
||||
^
|
||||
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:6:1: error: 'impl' function 'f3ext' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:6:1: error: actual function 'f3ext' has no corresponding expected declaration
|
||||
The following declaration is incompatible because parameter types are different:
|
||||
public expect fun String.f3ext(): Unit
|
||||
|
||||
actual fun Double.f3ext() {}
|
||||
^
|
||||
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:8:1: error: 'impl' function 'f4' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:8:1: error: actual function 'f4' has no corresponding expected declaration
|
||||
The following declaration is incompatible because parameter shapes are different (extension vs non-extension):
|
||||
public expect fun f4(name: String): Unit
|
||||
|
||||
actual fun String.f4() {}
|
||||
^
|
||||
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:10:1: error: 'impl' function 'f5' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:10:1: error: actual function 'f5' has no corresponding expected declaration
|
||||
The following declaration is incompatible because parameter shapes are different (extension vs non-extension):
|
||||
public expect fun String.f5(): Unit
|
||||
|
||||
actual fun f5(name: String) {}
|
||||
^
|
||||
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:12:1: error: 'impl' function 'f6' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:12:1: error: actual function 'f6' has no corresponding expected declaration
|
||||
The following declaration is incompatible because number of value parameters is different:
|
||||
public expect fun f6(p1: String, p2: Int): Unit
|
||||
|
||||
actual fun f6(p2: Int) {}
|
||||
^
|
||||
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:14:1: error: 'impl' function 'f7' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:14:1: error: actual function 'f7' has no corresponding expected declaration
|
||||
The following declaration is incompatible because number of type parameters is different:
|
||||
public expect fun <T> f7(): Unit
|
||||
|
||||
actual fun <K, V> f7() {}
|
||||
^
|
||||
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:16:1: error: 'impl' function 'f8' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:16:1: error: actual function 'f8' has no corresponding expected declaration
|
||||
The following declaration is incompatible because visibility is different:
|
||||
internal expect fun f8(): Unit
|
||||
|
||||
public actual fun f8() {}
|
||||
^
|
||||
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:17:1: error: 'impl' function 'f9' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:17:1: error: actual function 'f9' has no corresponding expected declaration
|
||||
The following declaration is incompatible because visibility is different:
|
||||
private expect fun f9(): Unit
|
||||
|
||||
internal actual fun f9() {}
|
||||
^
|
||||
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:18:1: error: 'impl' function 'f10' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:18:1: error: actual function 'f10' has no corresponding expected declaration
|
||||
The following declaration is incompatible because visibility is different:
|
||||
public expect fun f10(): Unit
|
||||
|
||||
private actual fun f10() {}
|
||||
^
|
||||
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:24:1: error: 'impl' function 'f14' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:24:1: error: actual function 'f14' has no corresponding expected declaration
|
||||
The following declaration is incompatible because some type parameter is reified in one declaration and non-reified in the other:
|
||||
public expect inline fun <X> f14(): Unit
|
||||
|
||||
actual inline fun <reified X> f14() {}
|
||||
^
|
||||
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:27:1: error: 'impl' function 'f16' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:27:1: error: actual function 'f16' has no corresponding expected declaration
|
||||
The following declaration is incompatible because some parameters have default values:
|
||||
public expect fun f16(s: String): Unit
|
||||
|
||||
actual fun f16(s: String = "") {}
|
||||
^
|
||||
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:29:1: error: 'impl' function 'f17' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:29:1: error: actual function 'f17' has no corresponding expected declaration
|
||||
The following declaration is incompatible because some value parameter is vararg in one declaration and non-vararg in the other:
|
||||
public expect fun f17(vararg s: String): Unit
|
||||
|
||||
actual fun f17(s: Array<out String>) {}
|
||||
^
|
||||
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:30:1: error: 'impl' function 'f18' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:30:1: error: actual function 'f18' has no corresponding expected declaration
|
||||
The following declaration is incompatible because some value parameter is vararg in one declaration and non-vararg in the other:
|
||||
public expect fun f18(s: Array<out String>): Unit
|
||||
|
||||
actual fun f18(vararg s: String) {}
|
||||
^
|
||||
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:31:1: error: 'impl' function 'f19' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:31:1: error: actual function 'f19' has no corresponding expected declaration
|
||||
The following declaration is incompatible because some value parameter is crossinline in one declaration and not crossinline in the other:
|
||||
public expect inline fun f19(s: () -> Unit): Unit
|
||||
|
||||
actual inline fun f19(crossinline s: () -> Unit) {}
|
||||
^
|
||||
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:32:1: error: 'impl' function 'f20' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:32:1: error: actual function 'f20' has no corresponding expected declaration
|
||||
The following declaration is incompatible because some value parameter is noinline in one declaration and not noinline in the other:
|
||||
public expect inline fun f20(s: () -> Unit): Unit
|
||||
|
||||
actual inline fun f20(noinline s: () -> Unit) {}
|
||||
^
|
||||
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:33:1: error: 'impl' function 'f21' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:33:1: error: actual function 'f21' has no corresponding expected declaration
|
||||
The following declaration is incompatible because parameter types are different:
|
||||
public expect fun f21(c: suspend Unit.() -> Unit): Unit
|
||||
|
||||
actual fun f21(c: Unit.() -> Unit) {}
|
||||
^
|
||||
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:34:1: error: 'impl' function 'f22' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleCallables/jvm.kt:34:1: error: actual function 'f22' has no corresponding expected declaration
|
||||
The following declaration is incompatible because parameter types are different:
|
||||
public expect fun f22(c: Unit.() -> Unit): Unit
|
||||
|
||||
|
||||
+14
-14
@@ -5,85 +5,85 @@ Output:
|
||||
-- JVM --
|
||||
Exit code: COMPILATION_ERROR
|
||||
Output:
|
||||
compiler/testData/multiplatform/incompatibleClasses/jvm.kt:1:18: error: 'impl' interface 'PClass' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleClasses/jvm.kt:1:18: error: actual interface 'PClass' has no corresponding expected declaration
|
||||
The following declaration is incompatible because class kinds are different (class, interface, object, enum, annotation):
|
||||
public final expect class PClass
|
||||
|
||||
actual interface PClass
|
||||
^
|
||||
compiler/testData/multiplatform/incompatibleClasses/jvm.kt:2:8: error: 'impl' object 'PInterface' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleClasses/jvm.kt:2:8: error: actual object 'PInterface' has no corresponding expected declaration
|
||||
The following declaration is incompatible because class kinds are different (class, interface, object, enum, annotation):
|
||||
public expect interface PInterface
|
||||
|
||||
actual object PInterface
|
||||
^
|
||||
compiler/testData/multiplatform/incompatibleClasses/jvm.kt:3:19: error: 'impl' enum class 'PObject' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleClasses/jvm.kt:3:19: error: actual enum class 'PObject' has no corresponding expected declaration
|
||||
The following declaration is incompatible because class kinds are different (class, interface, object, enum, annotation):
|
||||
public expect object PObject
|
||||
|
||||
actual enum class PObject
|
||||
^
|
||||
compiler/testData/multiplatform/incompatibleClasses/jvm.kt:4:25: error: 'impl' annotation class 'PEnumClass' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleClasses/jvm.kt:4:25: error: actual annotation class 'PEnumClass' has no corresponding expected declaration
|
||||
The following declaration is incompatible because class kinds are different (class, interface, object, enum, annotation):
|
||||
public final expect enum class PEnumClass : Enum<PEnumClass>
|
||||
|
||||
actual annotation class PEnumClass
|
||||
^
|
||||
compiler/testData/multiplatform/incompatibleClasses/jvm.kt:5:14: error: 'impl' class 'PAnnotationClass' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleClasses/jvm.kt:5:14: error: actual class 'PAnnotationClass' has no corresponding expected declaration
|
||||
The following declaration is incompatible because class kinds are different (class, interface, object, enum, annotation):
|
||||
public final expect annotation class PAnnotationClass : Annotation
|
||||
|
||||
actual class PAnnotationClass
|
||||
^
|
||||
compiler/testData/multiplatform/incompatibleClasses/jvm.kt:7:16: error: 'impl' object 'InternalObject' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleClasses/jvm.kt:7:16: error: actual object 'InternalObject' has no corresponding expected declaration
|
||||
The following declaration is incompatible because visibility is different:
|
||||
internal expect object InternalObject
|
||||
|
||||
private actual object InternalObject
|
||||
^
|
||||
compiler/testData/multiplatform/incompatibleClasses/jvm.kt:8:17: error: 'impl' object 'PublicObject' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleClasses/jvm.kt:8:17: error: actual object 'PublicObject' has no corresponding expected declaration
|
||||
The following declaration is incompatible because visibility is different:
|
||||
public expect object PublicObject
|
||||
|
||||
internal actual object PublicObject
|
||||
^
|
||||
compiler/testData/multiplatform/incompatibleClasses/jvm.kt:9:15: error: 'impl' object 'PrivateObject' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleClasses/jvm.kt:9:15: error: actual object 'PrivateObject' has no corresponding expected declaration
|
||||
The following declaration is incompatible because visibility is different:
|
||||
private expect object PrivateObject
|
||||
|
||||
public actual object PrivateObject
|
||||
^
|
||||
compiler/testData/multiplatform/incompatibleClasses/jvm.kt:11:20: error: 'impl' class 'OpenClass' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleClasses/jvm.kt:11:20: error: actual class 'OpenClass' has no corresponding expected declaration
|
||||
The following declaration is incompatible because modality is different:
|
||||
public open expect class OpenClass
|
||||
|
||||
final actual class OpenClass
|
||||
^
|
||||
compiler/testData/multiplatform/incompatibleClasses/jvm.kt:12:19: error: 'impl' class 'AbstractClass' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleClasses/jvm.kt:12:19: error: actual class 'AbstractClass' has no corresponding expected declaration
|
||||
The following declaration is incompatible because modality is different:
|
||||
public abstract expect class AbstractClass
|
||||
|
||||
open actual class AbstractClass
|
||||
^
|
||||
compiler/testData/multiplatform/incompatibleClasses/jvm.kt:13:23: error: 'impl' class 'FinalClass' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleClasses/jvm.kt:13:23: error: actual class 'FinalClass' has no corresponding expected declaration
|
||||
The following declaration is incompatible because modality is different:
|
||||
public final expect class FinalClass
|
||||
|
||||
abstract actual class FinalClass
|
||||
^
|
||||
compiler/testData/multiplatform/incompatibleClasses/jvm.kt:15:14: error: 'impl' class 'C1' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleClasses/jvm.kt:15:14: error: actual class 'C1' has no corresponding expected declaration
|
||||
The following declaration is incompatible because number of type parameters is different:
|
||||
public final expect class C1<A>
|
||||
|
||||
actual class C1<A, Extra>
|
||||
^
|
||||
compiler/testData/multiplatform/incompatibleClasses/jvm.kt:16:14: error: 'impl' class 'C2' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleClasses/jvm.kt:16:14: error: actual class 'C2' has no corresponding expected declaration
|
||||
The following declaration is incompatible because declaration-site variances of type parameters are different:
|
||||
public final expect class C2<B>
|
||||
|
||||
actual class C2<out B>
|
||||
^
|
||||
compiler/testData/multiplatform/incompatibleClasses/jvm.kt:22:23: error: 'impl' class 'ExtendsNumber' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleClasses/jvm.kt:22:23: error: actual class 'ExtendsNumber' has no corresponding expected declaration
|
||||
The following declaration is incompatible because some supertypes are missing in the actual declaration:
|
||||
public abstract expect class ExtendsNumber : Number
|
||||
|
||||
|
||||
@@ -5,31 +5,31 @@ Output:
|
||||
-- JVM --
|
||||
Exit code: COMPILATION_ERROR
|
||||
Output:
|
||||
compiler/testData/multiplatform/incompatibleFunctions/jvm.kt:1:1: error: 'impl' function 'plus' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleFunctions/jvm.kt:1:1: error: actual function 'plus' has no corresponding expected declaration
|
||||
The following declaration is incompatible because some modifiers on expected declaration are missing on the actual one (external, infix, inline, operator, tailrec):
|
||||
public infix expect fun Int.plus(s: CharSequence): Int
|
||||
|
||||
actual fun Int.plus(s: CharSequence): Int = 0
|
||||
^
|
||||
compiler/testData/multiplatform/incompatibleFunctions/jvm.kt:3:1: error: 'impl' function 'times' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleFunctions/jvm.kt:3:1: error: actual function 'times' has no corresponding expected declaration
|
||||
The following declaration is incompatible because some modifiers on expected declaration are missing on the actual one (external, infix, inline, operator, tailrec):
|
||||
public operator expect fun Double.times(x: CharArray): Unit
|
||||
|
||||
actual fun Double.times(x: CharArray) {}
|
||||
^
|
||||
compiler/testData/multiplatform/incompatibleFunctions/jvm.kt:5:1: error: 'impl' function 'f1' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleFunctions/jvm.kt:5:1: error: actual function 'f1' has no corresponding expected declaration
|
||||
The following declaration is incompatible because some modifiers on expected declaration are missing on the actual one (external, infix, inline, operator, tailrec):
|
||||
public external expect fun f1(): Unit
|
||||
|
||||
actual fun f1() {}
|
||||
^
|
||||
compiler/testData/multiplatform/incompatibleFunctions/jvm.kt:7:1: error: 'impl' function 'f2' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleFunctions/jvm.kt:7:1: error: actual function 'f2' has no corresponding expected declaration
|
||||
The following declaration is incompatible because some modifiers on expected declaration are missing on the actual one (external, infix, inline, operator, tailrec):
|
||||
public expect inline fun f2(): Unit
|
||||
|
||||
actual fun f2() {}
|
||||
^
|
||||
compiler/testData/multiplatform/incompatibleFunctions/jvm.kt:9:1: error: 'impl' function 'f3' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleFunctions/jvm.kt:9:1: error: actual function 'f3' has no corresponding expected declaration
|
||||
The following declaration is incompatible because some modifiers on expected declaration are missing on the actual one (external, infix, inline, operator, tailrec):
|
||||
public expect tailrec fun f3(): Unit
|
||||
|
||||
|
||||
@@ -5,49 +5,49 @@ Output:
|
||||
-- JVM --
|
||||
Exit code: COMPILATION_ERROR
|
||||
Output:
|
||||
compiler/testData/multiplatform/incompatibleNestedClasses/jvm.kt:2:22: error: 'impl' interface 'N1' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleNestedClasses/jvm.kt:2:22: error: actual interface 'N1' has no corresponding expected declaration
|
||||
The following declaration is incompatible because class kinds are different (class, interface, object, enum, annotation):
|
||||
public final expect class N1
|
||||
|
||||
actual interface N1
|
||||
^
|
||||
compiler/testData/multiplatform/incompatibleNestedClasses/jvm.kt:3:12: error: 'impl' object 'N2' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleNestedClasses/jvm.kt:3:12: error: actual object 'N2' has no corresponding expected declaration
|
||||
The following declaration is incompatible because class kinds are different (class, interface, object, enum, annotation):
|
||||
public expect interface N2
|
||||
|
||||
actual object N2
|
||||
^
|
||||
compiler/testData/multiplatform/incompatibleNestedClasses/jvm.kt:4:18: error: 'impl' class 'N3' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleNestedClasses/jvm.kt:4:18: error: actual class 'N3' has no corresponding expected declaration
|
||||
The following declaration is incompatible because class kinds are different (class, interface, object, enum, annotation):
|
||||
public expect object N3
|
||||
|
||||
actual class N3
|
||||
^
|
||||
compiler/testData/multiplatform/incompatibleNestedClasses/jvm.kt:8:24: error: 'impl' class 'N2' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleNestedClasses/jvm.kt:8:24: error: actual class 'N2' has no corresponding expected declaration
|
||||
The following declaration is incompatible because modifiers are different (companion, inner):
|
||||
public final expect class N2
|
||||
|
||||
actual inner class N2
|
||||
^
|
||||
compiler/testData/multiplatform/incompatibleNestedClasses/jvm.kt:9:18: error: 'impl' class 'I2' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleNestedClasses/jvm.kt:9:18: error: actual class 'I2' has no corresponding expected declaration
|
||||
The following declaration is incompatible because modifiers are different (companion, inner):
|
||||
public final expect inner class I2
|
||||
|
||||
actual class I2
|
||||
^
|
||||
compiler/testData/multiplatform/incompatibleNestedClasses/jvm.kt:13:22: error: 'impl' companion object 'Companion' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleNestedClasses/jvm.kt:13:22: error: actual companion object 'Companion' has no corresponding expected declaration
|
||||
The following declaration is incompatible because modifiers are different (companion, inner):
|
||||
public expect object Companion
|
||||
|
||||
actual companion object {}
|
||||
^
|
||||
compiler/testData/multiplatform/incompatibleNestedClasses/jvm.kt:14:12: error: 'impl' object 'Factory' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleNestedClasses/jvm.kt:14:12: error: actual object 'Factory' has no corresponding expected declaration
|
||||
The following declaration is incompatible because modifiers are different (companion, inner):
|
||||
public expect companion object Factory
|
||||
|
||||
actual object Factory
|
||||
^
|
||||
compiler/testData/multiplatform/incompatibleNestedClasses/jvm.kt:18:12: error: 'impl' object 'Companion' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleNestedClasses/jvm.kt:18:12: error: actual object 'Companion' has no corresponding expected declaration
|
||||
The following declaration is incompatible because modifiers are different (companion, inner):
|
||||
public expect companion object
|
||||
|
||||
|
||||
@@ -5,13 +5,13 @@ Output:
|
||||
-- JVM --
|
||||
Exit code: COMPILATION_ERROR
|
||||
Output:
|
||||
compiler/testData/multiplatform/incompatibleProperties/jvm.kt:1:1: error: 'impl' property 'pval' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleProperties/jvm.kt:1:1: error: actual property 'pval' has no corresponding expected declaration
|
||||
The following declaration is incompatible because property kinds are different (val vs var):
|
||||
public expect val pval: String
|
||||
|
||||
actual var pval: String = ""
|
||||
^
|
||||
compiler/testData/multiplatform/incompatibleProperties/jvm.kt:2:1: error: 'impl' property 'pvar' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incompatibleProperties/jvm.kt:2:1: error: actual property 'pvar' has no corresponding expected declaration
|
||||
The following declaration is incompatible because property kinds are different (val vs var):
|
||||
public expect var pvar: String
|
||||
|
||||
|
||||
@@ -5,15 +5,15 @@ Output:
|
||||
-- JVM --
|
||||
Exit code: COMPILATION_ERROR
|
||||
Output:
|
||||
compiler/testData/multiplatform/incorrectImplInClass/jvm.kt:2:12: error: 'impl' constructor of 'Foo' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incorrectImplInClass/jvm.kt:2:12: error: actual constructor of 'Foo' has no corresponding expected declaration
|
||||
The following declaration is incompatible because number of value parameters is different:
|
||||
public constructor Foo()
|
||||
|
||||
actual constructor(s: String) : this()
|
||||
^
|
||||
compiler/testData/multiplatform/incorrectImplInClass/jvm.kt:4:5: error: 'impl' function 'nonPlatformFun' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incorrectImplInClass/jvm.kt:4:5: error: actual function 'nonPlatformFun' has no corresponding expected declaration
|
||||
actual fun nonPlatformFun() {}
|
||||
^
|
||||
compiler/testData/multiplatform/incorrectImplInClass/jvm.kt:6:5: error: 'impl' property 'nonPlatformVal' has no corresponding 'header' declaration
|
||||
compiler/testData/multiplatform/incorrectImplInClass/jvm.kt:6:5: error: actual property 'nonPlatformVal' has no corresponding expected declaration
|
||||
actual val nonPlatformVal = ""
|
||||
^
|
||||
|
||||
@@ -5,13 +5,13 @@ Output:
|
||||
-- JVM --
|
||||
Exit code: COMPILATION_ERROR
|
||||
Output:
|
||||
compiler/testData/multiplatform/missingOverload/common.kt:7:1: error: 'header' function 'g' has no implementation in module
|
||||
compiler/testData/multiplatform/missingOverload/common.kt:7:1: error: expected function 'g' has no actual in module
|
||||
The following declaration is incompatible because parameter types are different:
|
||||
public actual fun g(a: Any): Unit
|
||||
|
||||
expect fun g(s: String)
|
||||
^
|
||||
compiler/testData/multiplatform/missingOverload/jvm.kt:1:14: error: 'impl' class 'Foo' has no implementation of 'header' class members:
|
||||
compiler/testData/multiplatform/missingOverload/jvm.kt:1:14: error: in class 'Foo' expected members have no actual ones:
|
||||
|
||||
public final expect fun f(a: Any): Unit
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -5,7 +5,7 @@ Output:
|
||||
-- JVM --
|
||||
Exit code: COMPILATION_ERROR
|
||||
Output:
|
||||
compiler/testData/multiplatform/regressions/incompatibleClassScopesWithImplTypeAlias/jvm.kt:3:1: error: 'impl' class 'Writer' has no implementation of 'header' class members:
|
||||
compiler/testData/multiplatform/regressions/incompatibleClassScopesWithImplTypeAlias/jvm.kt:3:1: error: in class 'Writer' expected members have no actual ones:
|
||||
|
||||
protected constructor Writer()
|
||||
|
||||
|
||||
@@ -175,13 +175,13 @@ public class IdeErrorMessages {
|
||||
MAP.put(EXPERIMENTAL_FEATURE_WARNING, "<html>{0}</html>", new LanguageFeatureMessageRenderer(LanguageFeatureMessageRenderer.Type.WARNING, true));
|
||||
MAP.put(EXPERIMENTAL_FEATURE_ERROR, "<html>{0}</html>", new LanguageFeatureMessageRenderer(LanguageFeatureMessageRenderer.Type.ERROR, true));
|
||||
|
||||
MAP.put(NO_ACTUAL_FOR_EXPECT, "<html>''header'' {0} has no implementation in module{1}{2}</html>", DECLARATION_NAME_WITH_KIND,
|
||||
MAP.put(NO_ACTUAL_FOR_EXPECT, "<html>Expected {0} has no actual in module{1}{2}</html>", DECLARATION_NAME_WITH_KIND,
|
||||
PLATFORM, new PlatformIncompatibilityDiagnosticRenderer(IdeMultiplatformDiagnosticRenderingMode.INSTANCE));
|
||||
MAP.put(ACTUAL_WITHOUT_EXPECT, "<html>''impl'' {0} has no corresponding ''header'' declaration{1}</html>", DECLARATION_NAME_WITH_KIND,
|
||||
MAP.put(ACTUAL_WITHOUT_EXPECT, "<html>Actual {0} has no corresponding expected declaration{1}</html>", DECLARATION_NAME_WITH_KIND,
|
||||
new PlatformIncompatibilityDiagnosticRenderer(IdeMultiplatformDiagnosticRenderingMode.INSTANCE));
|
||||
|
||||
MAP.put(NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS, "<html>''impl'' class ''{0}'' has no implementation of ''header'' class members:{1}</html>",
|
||||
NAME, new IncompatibleHeaderImplClassScopesRenderer(IdeMultiplatformDiagnosticRenderingMode.INSTANCE));
|
||||
MAP.put(NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS, "<html>In class ''{0}'' expected members have no actual ones:{1}</html>",
|
||||
NAME, new IncompatibleExpectedActualClassScopesRenderer(IdeMultiplatformDiagnosticRenderingMode.INSTANCE));
|
||||
|
||||
MAP.setImmutable();
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
expect class <error descr="[NO_ACTUAL_FOR_EXPECT] 'header' class 'My' has no implementation in module jvm for JVM">My</error> {
|
||||
expect class <error descr="[NO_ACTUAL_FOR_EXPECT] Expected class 'My' has no actual in module jvm for JVM">My</error> {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
actual class <error descr="[ACTUAL_WITHOUT_EXPECT] 'impl' class 'Your' has no corresponding 'header' declaration">Your</error> {
|
||||
actual class <error descr="[ACTUAL_WITHOUT_EXPECT] Actual class 'Your' has no corresponding expected declaration">Your</error> {
|
||||
|
||||
}
|
||||
|
||||
expect class <error descr="[NO_ACTUAL_FOR_EXPECT] 'header' class 'His' has no implementation in module jvm for JVM">His</error> {
|
||||
expect class <error descr="[NO_ACTUAL_FOR_EXPECT] Expected class 'His' has no actual in module jvm for JVM">His</error> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -1,3 +1,3 @@
|
||||
expect class <error descr="[NO_ACTUAL_FOR_EXPECT] 'header' class 'My' has no implementation in module js for JS"><error descr="[NO_ACTUAL_FOR_EXPECT] 'header' class 'My' has no implementation in module jvm for JVM">My</error></error> {
|
||||
expect class <error descr="[NO_ACTUAL_FOR_EXPECT] Expected class 'My' has no actual in module js for JS"><error descr="[NO_ACTUAL_FOR_EXPECT] Expected class 'My' has no actual in module jvm for JVM">My</error></error> {
|
||||
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -4,4 +4,4 @@
|
||||
expect interface Event
|
||||
|
||||
@Suppress("SOMETHING_WRONG")
|
||||
expect class <error descr="[NO_ACTUAL_FOR_EXPECT] 'header' class 'Wrong' has no implementation in module jvm for JVM">Wrong</error>
|
||||
expect class <error descr="[NO_ACTUAL_FOR_EXPECT] Expected class 'Wrong' has no actual in module jvm for JVM">Wrong</error>
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// "Implement members" "true"
|
||||
// WITH_RUNTIME
|
||||
// ERROR: 'header' interface 'InterfaceWithFuns' has no implementation in module light_idea_test_case for JVM
|
||||
// ERROR: Expected interface 'InterfaceWithFuns' has no actual in module light_idea_test_case for JVM
|
||||
expect interface InterfaceWithFuns {
|
||||
fun funInInterface()
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// "Implement members" "true"
|
||||
// WITH_RUNTIME
|
||||
// ERROR: 'header' interface 'InterfaceWithFuns' has no implementation in module light_idea_test_case for JVM
|
||||
// ERROR: Expected interface 'InterfaceWithFuns' has no actual in module light_idea_test_case for JVM
|
||||
expect interface InterfaceWithFuns {
|
||||
fun funInInterface()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user