K2: reproduce & add test for KT-56511
This commit is contained in:
committed by
Space Team
parent
e75fac271d
commit
0b31e5ad63
+6
@@ -30180,6 +30180,12 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
|
|||||||
runTest("compiler/testData/diagnostics/tests/smartCasts/smartCastAndArgumentApproximation.kt");
|
runTest("compiler/testData/diagnostics/tests/smartCasts/smartCastAndArgumentApproximation.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("smartCastOnAlienPropertyFromInnerClass.kt")
|
||||||
|
public void testSmartCastOnAlienPropertyFromInnerClass() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/smartCasts/smartCastOnAlienPropertyFromInnerClass.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("smartCastOnElvis.kt")
|
@TestMetadata("smartCastOnElvis.kt")
|
||||||
public void testSmartCastOnElvis() throws Exception {
|
public void testSmartCastOnElvis() throws Exception {
|
||||||
|
|||||||
+6
@@ -30180,6 +30180,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
|
|||||||
runTest("compiler/testData/diagnostics/tests/smartCasts/smartCastAndArgumentApproximation.kt");
|
runTest("compiler/testData/diagnostics/tests/smartCasts/smartCastAndArgumentApproximation.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("smartCastOnAlienPropertyFromInnerClass.kt")
|
||||||
|
public void testSmartCastOnAlienPropertyFromInnerClass() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/smartCasts/smartCastOnAlienPropertyFromInnerClass.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("smartCastOnElvis.kt")
|
@TestMetadata("smartCastOnElvis.kt")
|
||||||
public void testSmartCastOnElvis() throws Exception {
|
public void testSmartCastOnElvis() throws Exception {
|
||||||
|
|||||||
+6
@@ -30276,6 +30276,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
|
|||||||
runTest("compiler/testData/diagnostics/tests/smartCasts/smartCastAndArgumentApproximation.kt");
|
runTest("compiler/testData/diagnostics/tests/smartCasts/smartCastAndArgumentApproximation.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("smartCastOnAlienPropertyFromInnerClass.kt")
|
||||||
|
public void testSmartCastOnAlienPropertyFromInnerClass() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/smartCasts/smartCastOnAlienPropertyFromInnerClass.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("smartCastOnElvis.kt")
|
@TestMetadata("smartCastOnElvis.kt")
|
||||||
public void testSmartCastOnElvis() throws Exception {
|
public void testSmartCastOnElvis() throws Exception {
|
||||||
|
|||||||
Vendored
+15
@@ -0,0 +1,15 @@
|
|||||||
|
// MODULE: m1
|
||||||
|
// FILE: A.kt
|
||||||
|
|
||||||
|
open class Base(val x: Any)
|
||||||
|
|
||||||
|
// MODULE: m2(m1)
|
||||||
|
// FILE: B.kt
|
||||||
|
|
||||||
|
private class Derived : Base("123") {
|
||||||
|
fun foo() {
|
||||||
|
if (x is String) {
|
||||||
|
<!SMARTCAST_IMPOSSIBLE!>x<!>.length
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+15
@@ -0,0 +1,15 @@
|
|||||||
|
// MODULE: m1
|
||||||
|
// FILE: A.kt
|
||||||
|
|
||||||
|
open class Base(val x: Any)
|
||||||
|
|
||||||
|
// MODULE: m2(m1)
|
||||||
|
// FILE: B.kt
|
||||||
|
|
||||||
|
private class Derived : Base("123") {
|
||||||
|
fun foo() {
|
||||||
|
if (x is String) {
|
||||||
|
<!DEBUG_INFO_SMARTCAST!>x<!>.length
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Generated
+6
@@ -30276,6 +30276,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
|||||||
runTest("compiler/testData/diagnostics/tests/smartCasts/smartCastAndArgumentApproximation.kt");
|
runTest("compiler/testData/diagnostics/tests/smartCasts/smartCastAndArgumentApproximation.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("smartCastOnAlienPropertyFromInnerClass.kt")
|
||||||
|
public void testSmartCastOnAlienPropertyFromInnerClass() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/smartCasts/smartCastOnAlienPropertyFromInnerClass.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("smartCastOnElvis.kt")
|
@TestMetadata("smartCastOnElvis.kt")
|
||||||
public void testSmartCastOnElvis() throws Exception {
|
public void testSmartCastOnElvis() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user