[FIR] KT-57458: Ensure the current K2 behavior differs from K1

This commit is contained in:
Nikolay Lunyak
2023-03-22 13:58:32 +02:00
committed by Space Team
parent f73ce25dbd
commit 8096e94c88
9 changed files with 132 additions and 0 deletions
@@ -969,6 +969,18 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
runTest("compiler/testData/diagnostics/tests/SupertypeListChecks.kt");
}
@Test
@TestMetadata("suppressExposedPropertyTypeInConstructor.kt")
public void testSuppressExposedPropertyTypeInConstructor() throws Exception {
runTest("compiler/testData/diagnostics/tests/suppressExposedPropertyTypeInConstructor.kt");
}
@Test
@TestMetadata("suppressExposedPropertyTypeInPrivateConstructor.kt")
public void testSuppressExposedPropertyTypeInPrivateConstructor() throws Exception {
runTest("compiler/testData/diagnostics/tests/suppressExposedPropertyTypeInPrivateConstructor.kt");
}
@Test
@TestMetadata("SyntaxErrorInTestHighlighting.kt")
public void testSyntaxErrorInTestHighlighting() throws Exception {
@@ -969,6 +969,18 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
runTest("compiler/testData/diagnostics/tests/SupertypeListChecks.kt");
}
@Test
@TestMetadata("suppressExposedPropertyTypeInConstructor.kt")
public void testSuppressExposedPropertyTypeInConstructor() throws Exception {
runTest("compiler/testData/diagnostics/tests/suppressExposedPropertyTypeInConstructor.kt");
}
@Test
@TestMetadata("suppressExposedPropertyTypeInPrivateConstructor.kt")
public void testSuppressExposedPropertyTypeInPrivateConstructor() throws Exception {
runTest("compiler/testData/diagnostics/tests/suppressExposedPropertyTypeInPrivateConstructor.kt");
}
@Test
@TestMetadata("SyntaxErrorInTestHighlighting.kt")
public void testSyntaxErrorInTestHighlighting() throws Exception {
@@ -969,6 +969,18 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
runTest("compiler/testData/diagnostics/tests/SupertypeListChecks.kt");
}
@Test
@TestMetadata("suppressExposedPropertyTypeInConstructor.kt")
public void testSuppressExposedPropertyTypeInConstructor() throws Exception {
runTest("compiler/testData/diagnostics/tests/suppressExposedPropertyTypeInConstructor.kt");
}
@Test
@TestMetadata("suppressExposedPropertyTypeInPrivateConstructor.kt")
public void testSuppressExposedPropertyTypeInPrivateConstructor() throws Exception {
runTest("compiler/testData/diagnostics/tests/suppressExposedPropertyTypeInPrivateConstructor.kt");
}
@Test
@TestMetadata("SyntaxErrorInTestHighlighting.kt")
public void testSyntaxErrorInTestHighlighting() throws Exception {
@@ -969,6 +969,18 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
runTest("compiler/testData/diagnostics/tests/SupertypeListChecks.kt");
}
@Test
@TestMetadata("suppressExposedPropertyTypeInConstructor.kt")
public void testSuppressExposedPropertyTypeInConstructor() throws Exception {
runTest("compiler/testData/diagnostics/tests/suppressExposedPropertyTypeInConstructor.kt");
}
@Test
@TestMetadata("suppressExposedPropertyTypeInPrivateConstructor.kt")
public void testSuppressExposedPropertyTypeInPrivateConstructor() throws Exception {
runTest("compiler/testData/diagnostics/tests/suppressExposedPropertyTypeInPrivateConstructor.kt");
}
@Test
@TestMetadata("SyntaxErrorInTestHighlighting.kt")
public void testSyntaxErrorInTestHighlighting() throws Exception {
@@ -0,0 +1,18 @@
// ISSUE: KT-57458
private enum class Foo { A, B }
class Bar constructor(
<!EXPOSED_PARAMETER_TYPE!>@Suppress("EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR_ERROR")
val <!EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR_ERROR!>foo<!>: Foo<!>,
)
class Var constructor(
<!EXPOSED_PARAMETER_TYPE!>@property:Suppress("EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR_ERROR")
val foo: Foo<!>,
)
class Zar constructor(
<!EXPOSED_PARAMETER_TYPE!>@param:Suppress("EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR_ERROR")
val <!EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR_ERROR!>foo<!>: Foo<!>,
)
@@ -0,0 +1,18 @@
// ISSUE: KT-57458
private enum class Foo { A, B }
class Bar constructor(
<!EXPOSED_PARAMETER_TYPE!>@Suppress("EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR_ERROR")
val foo: Foo<!>,
)
class Var constructor(
<!EXPOSED_PARAMETER_TYPE!>@property:Suppress("EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR_ERROR")
val foo: Foo<!>,
)
class Zar constructor(
<!EXPOSED_PARAMETER_TYPE!>@param:Suppress("EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR_ERROR")
val foo: Foo<!>,
)
@@ -0,0 +1,18 @@
// ISSUE: KT-57458
private enum class Foo { A, B }
class Bar private constructor(
@Suppress("EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR_ERROR")
val <!EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR_ERROR!>foo<!>: Foo,
)
class Var private constructor(
@property:Suppress("EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR_ERROR")
val foo: Foo,
)
class Zar private constructor(
@param:Suppress("EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR_ERROR")
val <!EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR_ERROR!>foo<!>: Foo,
)
@@ -0,0 +1,18 @@
// ISSUE: KT-57458
private enum class Foo { A, B }
class Bar private constructor(
@Suppress("EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR_ERROR")
val foo: Foo,
)
class Var private constructor(
@property:Suppress("EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR_ERROR")
val <!EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR_ERROR!>foo<!>: Foo,
)
class Zar private constructor(
@param:Suppress("EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR_ERROR")
val foo: Foo,
)
@@ -969,6 +969,18 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
runTest("compiler/testData/diagnostics/tests/SupertypeListChecks.kt");
}
@Test
@TestMetadata("suppressExposedPropertyTypeInConstructor.kt")
public void testSuppressExposedPropertyTypeInConstructor() throws Exception {
runTest("compiler/testData/diagnostics/tests/suppressExposedPropertyTypeInConstructor.kt");
}
@Test
@TestMetadata("suppressExposedPropertyTypeInPrivateConstructor.kt")
public void testSuppressExposedPropertyTypeInPrivateConstructor() throws Exception {
runTest("compiler/testData/diagnostics/tests/suppressExposedPropertyTypeInPrivateConstructor.kt");
}
@Test
@TestMetadata("SyntaxErrorInTestHighlighting.kt")
public void testSyntaxErrorInTestHighlighting() throws Exception {