456d3e0f42
In K1 .isFun is always false for Java classes, so extra check is added for that. This is not needed for K2, because .isFun is true for all Java classes. Here it is not necessary to check that interface has only one method, because such check will be done in the place where interface implementation is created. ^KT-39362 Fixed
128 lines
6.5 KiB
Plaintext
Vendored
128 lines
6.5 KiB
Plaintext
Vendored
-- Common --
|
|
Exit code: OK
|
|
Output:
|
|
|
|
-- JVM --
|
|
Exit code: COMPILATION_ERROR
|
|
Output:
|
|
compiler/testData/multiplatform/incompatibleClasses/common.kt:14:16: error: expected class 'C1' has no actual declaration in module <main> for JVM
|
|
The following declaration is incompatible because number of type parameters is different:
|
|
public final actual class C1<A, Extra>
|
|
|
|
expect class C1<A>
|
|
^
|
|
compiler/testData/multiplatform/incompatibleClasses/common.kt:16:16: error: expected class 'C3' has no actual declaration in module <main> for JVM
|
|
The following declaration is incompatible because upper bounds of type parameters are different:
|
|
public final actual class C3<D, E : D?>
|
|
|
|
expect class C3<D, E : D>
|
|
^
|
|
compiler/testData/multiplatform/incompatibleClasses/common.kt:18:16: error: expected class 'C4' has no actual declaration in module <main> for JVM
|
|
The following declaration is incompatible because upper bounds of type parameters are different:
|
|
public actual typealias C4<F> = C4Impl<F>
|
|
|
|
expect class C4<F>
|
|
^
|
|
compiler/testData/multiplatform/incompatibleClasses/jvm.kt:1:8: 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: 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:8: 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:8: 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:8: 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:1: 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:8:1: error: actual object 'InternalObject' has no corresponding expected declaration
|
|
The following declaration is incompatible because visibility is different:
|
|
internal expect object InternalObject
|
|
|
|
public actual object InternalObject
|
|
^
|
|
compiler/testData/multiplatform/incompatibleClasses/jvm.kt:10:1: 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:11:1: 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:12:1: 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:14:16: 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:15:16: 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:16:16: error: actual class 'C3' has no corresponding expected declaration
|
|
The following declaration is incompatible because upper bounds of type parameters are different:
|
|
public final expect class C3<D, E : D>
|
|
|
|
actual class C3<D, E : D?>
|
|
^
|
|
compiler/testData/multiplatform/incompatibleClasses/jvm.kt:18:20: error: actual typealias 'C4' has no corresponding expected declaration
|
|
The following declaration is incompatible because upper bounds of type parameters are different:
|
|
public final expect class C4<F>
|
|
|
|
actual typealias C4<F> = C4Impl<F>
|
|
^
|
|
compiler/testData/multiplatform/incompatibleClasses/jvm.kt:21:39: 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
|
|
|
|
actual abstract class ExtendsNumber : Any()
|
|
^
|
|
compiler/testData/multiplatform/incompatibleClasses/jvm.kt:23:1: error: actual interface 'FunInterface' has no corresponding expected declaration
|
|
The following declaration is incompatible because actual declaration for fun expect interface is not a functional interface:
|
|
public expect fun interface FunInterface
|
|
|
|
actual interface FunInterface {
|
|
^
|
|
compiler/testData/multiplatform/incompatibleClasses/jvm.kt:31:1: error: actual typealias 'FunInterface2' has no corresponding expected declaration
|
|
The following declaration is incompatible because actual declaration for fun expect interface is not a functional interface:
|
|
public expect fun interface FunInterface2
|
|
|
|
actual typealias FunInterface2 = FunInterface2Typealias
|
|
^
|