[Test] Extract test for EXPECTED_CLASS_CONSTRUCTOR_PROPERTY_PARAMETER
...to separate file. Also, add 3 cases with true-negative reporting: annotation class, value class and secondary constructor. ^KT-59982
This commit is contained in:
committed by
Space Team
parent
489371219f
commit
5623427c6d
+6
@@ -1320,6 +1320,12 @@ public class FirOldFrontendMPPDiagnosticsWithLightTreeTestGenerated extends Abst
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/headerClass/expectFunInterface.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("expectedClassConstructorPropertyParameters.kt")
|
||||
public void testExpectedClassConstructorPropertyParameters() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/headerClass/expectedClassConstructorPropertyParameters.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("explicitConstructorDelegation.kt")
|
||||
public void testExplicitConstructorDelegation() throws Exception {
|
||||
|
||||
+6
@@ -1320,6 +1320,12 @@ public class FirOldFrontendMPPDiagnosticsWithPsiTestGenerated extends AbstractFi
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/headerClass/expectFunInterface.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("expectedClassConstructorPropertyParameters.kt")
|
||||
public void testExpectedClassConstructorPropertyParameters() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/headerClass/expectedClassConstructorPropertyParameters.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("explicitConstructorDelegation.kt")
|
||||
public void testExplicitConstructorDelegation() throws Exception {
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// DIAGNOSTICS: -NO_ACTUAL_FOR_EXPECT
|
||||
// MODULE: m1-common
|
||||
// FILE: common.kt
|
||||
expect class Foo(
|
||||
val constructorProperty: String,
|
||||
var constructorVar: String,
|
||||
constructorParameter: String,
|
||||
) {
|
||||
constructor(<!VAL_OR_VAR_ON_SECONDARY_CONSTRUCTOR_PARAMETER!>val<!> notReported: String)
|
||||
}
|
||||
|
||||
expect annotation class Ann(val s: String)
|
||||
|
||||
expect value class ValueClass(val s: String)
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// DIAGNOSTICS: -NO_ACTUAL_FOR_EXPECT
|
||||
// MODULE: m1-common
|
||||
// FILE: common.kt
|
||||
expect class Foo(
|
||||
<!EXPECTED_CLASS_CONSTRUCTOR_PROPERTY_PARAMETER!>val constructorProperty: String<!>,
|
||||
<!EXPECTED_CLASS_CONSTRUCTOR_PROPERTY_PARAMETER!>var constructorVar: String<!>,
|
||||
constructorParameter: String,
|
||||
) {
|
||||
constructor(<!VAL_OR_VAR_ON_SECONDARY_CONSTRUCTOR_PARAMETER!>val<!> notReported: String)
|
||||
}
|
||||
|
||||
expect annotation class Ann(val s: String)
|
||||
|
||||
expect value class ValueClass(val s: String)
|
||||
Vendored
+1
-4
@@ -1,10 +1,7 @@
|
||||
// IGNORE_REVERSED_RESOLVE
|
||||
// MODULE: m1-common
|
||||
// FILE: common.kt
|
||||
<!NO_ACTUAL_FOR_EXPECT!>expect class Foo(
|
||||
val constructorProperty: String,
|
||||
constructorParameter: String
|
||||
) {
|
||||
<!NO_ACTUAL_FOR_EXPECT!>expect class Foo {
|
||||
<!EXPECTED_DECLARATION_WITH_BODY!>init<!> {
|
||||
"no"
|
||||
}
|
||||
|
||||
Vendored
+1
-4
@@ -1,10 +1,7 @@
|
||||
// IGNORE_REVERSED_RESOLVE
|
||||
// MODULE: m1-common
|
||||
// FILE: common.kt
|
||||
expect class Foo(
|
||||
<!EXPECTED_CLASS_CONSTRUCTOR_PROPERTY_PARAMETER!>val constructorProperty: String<!>,
|
||||
constructorParameter: String
|
||||
) {
|
||||
expect class Foo {
|
||||
<!EXPECTED_DECLARATION_WITH_BODY!>init<!> {
|
||||
"no"
|
||||
}
|
||||
|
||||
Vendored
+1
-2
@@ -3,8 +3,6 @@ package
|
||||
public final expect class Foo {
|
||||
public constructor Foo()
|
||||
public constructor Foo(/*0*/ s: kotlin.String)
|
||||
public constructor Foo(/*0*/ constructorProperty: kotlin.String, /*1*/ constructorParameter: kotlin.String)
|
||||
public expect final val constructorProperty: kotlin.String
|
||||
public expect final var getSet: kotlin.String
|
||||
public expect final val prop: kotlin.String = "no"
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
@@ -12,3 +10,4 @@ public final expect class Foo {
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
|
||||
Generated
+6
@@ -24321,6 +24321,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/headerClass/expectFunInterface.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("expectedClassConstructorPropertyParameters.kt")
|
||||
public void testExpectedClassConstructorPropertyParameters() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/headerClass/expectedClassConstructorPropertyParameters.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("explicitConstructorDelegation.kt")
|
||||
public void testExplicitConstructorDelegation() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user