[Test] Add test for KT-45814
^KT-45814 Can't reproduce
This commit is contained in:
committed by
Space Team
parent
a1a9a55e1a
commit
d01a2c7271
+6
@@ -29542,6 +29542,12 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
|
|||||||
runTest("compiler/testData/diagnostics/tests/smartCasts/kt3993.kt");
|
runTest("compiler/testData/diagnostics/tests/smartCasts/kt3993.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt45814.kt")
|
||||||
|
public void testKt45814() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/smartCasts/kt45814.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt51460.kt")
|
@TestMetadata("kt51460.kt")
|
||||||
public void testKt51460() throws Exception {
|
public void testKt51460() throws Exception {
|
||||||
|
|||||||
+6
@@ -29638,6 +29638,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
|||||||
runTest("compiler/testData/diagnostics/tests/smartCasts/kt3993.kt");
|
runTest("compiler/testData/diagnostics/tests/smartCasts/kt3993.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt45814.kt")
|
||||||
|
public void testKt45814() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/smartCasts/kt45814.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt51460.kt")
|
@TestMetadata("kt51460.kt")
|
||||||
public void testKt51460() throws Exception {
|
public void testKt51460() throws Exception {
|
||||||
|
|||||||
+6
@@ -29542,6 +29542,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
|
|||||||
runTest("compiler/testData/diagnostics/tests/smartCasts/kt3993.kt");
|
runTest("compiler/testData/diagnostics/tests/smartCasts/kt3993.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt45814.kt")
|
||||||
|
public void testKt45814() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/smartCasts/kt45814.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt51460.kt")
|
@TestMetadata("kt51460.kt")
|
||||||
public void testKt51460() throws Exception {
|
public void testKt51460() throws Exception {
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
// SKIP_TXT
|
||||||
|
// ISSUE: KT-45814
|
||||||
|
|
||||||
|
class Foo(val bar: String?)
|
||||||
|
|
||||||
|
fun test_1(foo: Foo?) {
|
||||||
|
foo!!.bar.let {
|
||||||
|
foo<!UNNECESSARY_SAFE_CALL!>?.<!>bar?.length // Unnecessary
|
||||||
|
foo.bar?.length // Correct
|
||||||
|
foo<!UNNECESSARY_SAFE_CALL!>?.<!>bar?.length // Unnecessary
|
||||||
|
}
|
||||||
|
foo.bar?.length
|
||||||
|
foo<!UNNECESSARY_SAFE_CALL!>?.<!>bar?.length // Unnecessary
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test_2(foo: Foo?) {
|
||||||
|
foo!!.bar.let {
|
||||||
|
foo.bar?.length // Correct
|
||||||
|
foo<!UNNECESSARY_SAFE_CALL!>?.<!>bar?.length // Unnecessary
|
||||||
|
Unit
|
||||||
|
}
|
||||||
|
foo.bar?.length
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
// SKIP_TXT
|
||||||
|
// ISSUE: KT-45814
|
||||||
|
|
||||||
|
class Foo(val bar: String?)
|
||||||
|
|
||||||
|
fun test_1(foo: Foo?) {
|
||||||
|
foo!!.bar.let {
|
||||||
|
foo<!UNNECESSARY_SAFE_CALL!>?.<!>bar?.length // Unnecessary
|
||||||
|
<!DEBUG_INFO_SMARTCAST!>foo<!>.bar?.length // Correct
|
||||||
|
foo<!UNNECESSARY_SAFE_CALL!>?.<!>bar?.length // Unnecessary
|
||||||
|
}
|
||||||
|
<!DEBUG_INFO_SMARTCAST!>foo<!>.bar?.length
|
||||||
|
foo<!UNNECESSARY_SAFE_CALL!>?.<!>bar?.length // Unnecessary
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test_2(foo: Foo?) {
|
||||||
|
foo!!.bar.let {
|
||||||
|
<!DEBUG_INFO_SMARTCAST!>foo<!>.bar?.length // Correct
|
||||||
|
foo<!UNNECESSARY_SAFE_CALL!>?.<!>bar?.length // Unnecessary
|
||||||
|
Unit
|
||||||
|
}
|
||||||
|
<!DEBUG_INFO_SMARTCAST!>foo<!>.bar?.length
|
||||||
|
}
|
||||||
Generated
+6
@@ -29638,6 +29638,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
|||||||
runTest("compiler/testData/diagnostics/tests/smartCasts/kt3993.kt");
|
runTest("compiler/testData/diagnostics/tests/smartCasts/kt3993.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt45814.kt")
|
||||||
|
public void testKt45814() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/smartCasts/kt45814.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt51460.kt")
|
@TestMetadata("kt51460.kt")
|
||||||
public void testKt51460() throws Exception {
|
public void testKt51460() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user