[Test] Improve test of SUPERTYPE_INITIALIZED_IN_EXPECTED_CLASS diagnostic
Add case where explicit primary constructor is present in expect, so that SUPERTYPE_INITIALIZED_WITHOUT_PRIMARY_CONSTRUCTOR is not reported. ^KT-59979
This commit is contained in:
committed by
Space Team
parent
13b6653899
commit
32a87836c2
+6
@@ -9,14 +9,20 @@ expect class Foo : I, C, J
|
||||
|
||||
<!INCOMPATIBLE_MATCHING{JVM}, SUPERTYPE_INITIALIZED_WITHOUT_PRIMARY_CONSTRUCTOR, SUPERTYPE_INITIALIZED_WITHOUT_PRIMARY_CONSTRUCTOR!>expect class Bar : C()<!>
|
||||
|
||||
expect class WithExplicitPrimaryConstructor() : C()
|
||||
|
||||
// MODULE: m2-jvm()()(m1-common)
|
||||
// FILE: jvm.kt
|
||||
actual class Foo : I, C(), J
|
||||
|
||||
actual class <!ACTUAL_WITHOUT_EXPECT!>Bar<!>
|
||||
|
||||
actual class WithExplicitPrimaryConstructor : C()
|
||||
|
||||
// MODULE: m3-js()()(m1-common)
|
||||
// FILE: js.kt
|
||||
actual class Foo : I, J, C()
|
||||
|
||||
actual class Bar : C()
|
||||
|
||||
actual class WithExplicitPrimaryConstructor : C()
|
||||
|
||||
@@ -9,14 +9,20 @@ expect class Foo : I, C, J
|
||||
|
||||
expect class Bar : <!SUPERTYPE_INITIALIZED_WITHOUT_PRIMARY_CONSTRUCTOR, SUPERTYPE_INITIALIZED_WITHOUT_PRIMARY_CONSTRUCTOR{JVM}, SUPERTYPE_INITIALIZED_WITHOUT_PRIMARY_CONSTRUCTOR{JS}!>C<!SUPERTYPE_INITIALIZED_IN_EXPECTED_CLASS, SUPERTYPE_INITIALIZED_IN_EXPECTED_CLASS{JVM}, SUPERTYPE_INITIALIZED_IN_EXPECTED_CLASS{JS}!>()<!><!>
|
||||
|
||||
expect class WithExplicitPrimaryConstructor() : C<!SUPERTYPE_INITIALIZED_IN_EXPECTED_CLASS, SUPERTYPE_INITIALIZED_IN_EXPECTED_CLASS{JVM}, SUPERTYPE_INITIALIZED_IN_EXPECTED_CLASS{JS}!>()<!>
|
||||
|
||||
// MODULE: m2-jvm()()(m1-common)
|
||||
// FILE: jvm.kt
|
||||
actual class Foo : I, C(), J
|
||||
|
||||
actual class <!ACTUAL_WITHOUT_EXPECT!>Bar<!>
|
||||
|
||||
actual class WithExplicitPrimaryConstructor : C()
|
||||
|
||||
// MODULE: m3-js()()(m1-common)
|
||||
// FILE: js.kt
|
||||
actual class Foo : I, J, C()
|
||||
|
||||
actual class Bar : C()
|
||||
|
||||
actual class WithExplicitPrimaryConstructor : C()
|
||||
|
||||
@@ -32,6 +32,13 @@ public interface J {
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final expect class WithExplicitPrimaryConstructor : C {
|
||||
public constructor WithExplicitPrimaryConstructor()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
// -- Module: <m2-jvm> --
|
||||
package
|
||||
|
||||
@@ -68,6 +75,13 @@ public interface J {
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final actual class WithExplicitPrimaryConstructor : C {
|
||||
public constructor WithExplicitPrimaryConstructor()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
// -- Module: <m3-js> --
|
||||
package
|
||||
|
||||
@@ -104,3 +118,10 @@ public interface J {
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final actual class WithExplicitPrimaryConstructor : C {
|
||||
public constructor WithExplicitPrimaryConstructor()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user