[Test] Add test for current behavior of resolution of nested class type

...when it is actualized via typealias.

^KT-31636
This commit is contained in:
Roman Efremov
2023-11-23 12:16:50 +01:00
committed by Space Team
parent 205690b220
commit 5147a5e805
7 changed files with 68 additions and 0 deletions
@@ -24060,6 +24060,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
runTest("compiler/testData/diagnostics/tests/multiplatform/supertypeActualizationWithAny.kt");
}
@Test
@TestMetadata("typeResolutionOfNestedClassActualizedViaTypealias.kt")
public void testTypeResolutionOfNestedClassActualizedViaTypealias() throws Exception {
runTest("compiler/testData/diagnostics/tests/multiplatform/typeResolutionOfNestedClassActualizedViaTypealias.kt");
}
@Test
@TestMetadata("varSetterVisibility.kt")
public void testVarSetterVisibility() throws Exception {
@@ -24060,6 +24060,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
runTest("compiler/testData/diagnostics/tests/multiplatform/supertypeActualizationWithAny.kt");
}
@Test
@TestMetadata("typeResolutionOfNestedClassActualizedViaTypealias.kt")
public void testTypeResolutionOfNestedClassActualizedViaTypealias() throws Exception {
runTest("compiler/testData/diagnostics/tests/multiplatform/typeResolutionOfNestedClassActualizedViaTypealias.kt");
}
@Test
@TestMetadata("varSetterVisibility.kt")
public void testVarSetterVisibility() throws Exception {
@@ -421,6 +421,12 @@ public class FirOldFrontendMPPDiagnosticsWithLightTreeTestGenerated extends Abst
runTest("compiler/testData/diagnostics/tests/multiplatform/supertypeActualizationWithAny.kt");
}
@Test
@TestMetadata("typeResolutionOfNestedClassActualizedViaTypealias.kt")
public void testTypeResolutionOfNestedClassActualizedViaTypealias() throws Exception {
runTest("compiler/testData/diagnostics/tests/multiplatform/typeResolutionOfNestedClassActualizedViaTypealias.kt");
}
@Test
@TestMetadata("varSetterVisibility.kt")
public void testVarSetterVisibility() throws Exception {
@@ -421,6 +421,12 @@ public class FirOldFrontendMPPDiagnosticsWithPsiTestGenerated extends AbstractFi
runTest("compiler/testData/diagnostics/tests/multiplatform/supertypeActualizationWithAny.kt");
}
@Test
@TestMetadata("typeResolutionOfNestedClassActualizedViaTypealias.kt")
public void testTypeResolutionOfNestedClassActualizedViaTypealias() throws Exception {
runTest("compiler/testData/diagnostics/tests/multiplatform/typeResolutionOfNestedClassActualizedViaTypealias.kt");
}
@Test
@TestMetadata("varSetterVisibility.kt")
public void testVarSetterVisibility() throws Exception {
@@ -0,0 +1,19 @@
// MODULE: m1-common
// FILE: common.kt
expect class Foo {
class Nested
}
fun foo(p: Foo.Nested) {}
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
class FooImpl {
class Nested
}
actual typealias Foo = FooImpl
fun test() {
foo(<!ARGUMENT_TYPE_MISMATCH!>FooImpl.Nested()<!>)
}
@@ -0,0 +1,19 @@
// MODULE: m1-common
// FILE: common.kt
expect class Foo {
class Nested
}
fun foo(p: Foo.<!UNRESOLVED_REFERENCE{JVM}!>Nested<!>) {}
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
class FooImpl {
class Nested
}
actual typealias Foo = FooImpl
fun test() {
foo(FooImpl.Nested())
}
@@ -24060,6 +24060,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
runTest("compiler/testData/diagnostics/tests/multiplatform/supertypeActualizationWithAny.kt");
}
@Test
@TestMetadata("typeResolutionOfNestedClassActualizedViaTypealias.kt")
public void testTypeResolutionOfNestedClassActualizedViaTypealias() throws Exception {
runTest("compiler/testData/diagnostics/tests/multiplatform/typeResolutionOfNestedClassActualizedViaTypealias.kt");
}
@Test
@TestMetadata("varSetterVisibility.kt")
public void testVarSetterVisibility() throws Exception {