Split testdata of #KT-25432 and #KT-29767
This commit is contained in:
@@ -1,18 +1,11 @@
|
|||||||
// !WITH_NEW_INFERENCE
|
// !WITH_NEW_INFERENCE
|
||||||
|
// ISSUE: KT-25432
|
||||||
|
|
||||||
class Data<T>(val s: T)
|
class Data<T>(val s: T)
|
||||||
|
|
||||||
fun test_1(d: Data<out Any>) {
|
fun test(d: Data<out Any>) {
|
||||||
if (d.s is String) {
|
if (d.s is String) {
|
||||||
<!OI;DEBUG_INFO_SMARTCAST!>d.s<!>.<!NI;UNRESOLVED_REFERENCE!>length<!>
|
<!OI;DEBUG_INFO_SMARTCAST!>d.s<!>.<!NI;UNRESOLVED_REFERENCE!>length<!>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun test_2(a: MutableList<out Int?>?) {
|
|
||||||
if (a != null) {
|
|
||||||
val b = <!OI;DEBUG_INFO_SMARTCAST!>a<!>[0] // no SMARTCAST diagnostic
|
|
||||||
if (b != null) {
|
|
||||||
<!DEBUG_INFO_SMARTCAST!>b<!>.inc()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public fun test_1(/*0*/ d: Data<out kotlin.Any>): kotlin.Unit
|
public fun test(/*0*/ d: Data<out kotlin.Any>): kotlin.Unit
|
||||||
public fun test_2(/*0*/ a: kotlin.collections.MutableList<out kotlin.Int?>?): kotlin.Unit
|
|
||||||
|
|
||||||
public final class Data</*0*/ T> {
|
public final class Data</*0*/ T> {
|
||||||
public constructor Data</*0*/ T>(/*0*/ s: T)
|
public constructor Data</*0*/ T>(/*0*/ s: T)
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
// !WITH_NEW_INFERENCE
|
||||||
|
// ISSUE: KT-29767
|
||||||
|
|
||||||
|
fun test(a: MutableList<out Int?>?) {
|
||||||
|
if (a != null) {
|
||||||
|
val b = <!OI;DEBUG_INFO_SMARTCAST!>a<!>[0] // no SMARTCAST diagnostic
|
||||||
|
if (b != null) {
|
||||||
|
<!DEBUG_INFO_SMARTCAST!>b<!>.inc()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
package
|
||||||
|
|
||||||
|
public fun test(/*0*/ a: kotlin.collections.MutableList<out kotlin.Int?>?): kotlin.Unit
|
||||||
@@ -19894,6 +19894,11 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
|
|||||||
runTest("compiler/testData/diagnostics/tests/smartCasts/inference/kt2851.kt");
|
runTest("compiler/testData/diagnostics/tests/smartCasts/inference/kt2851.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt29767.kt")
|
||||||
|
public void testKt29767() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/smartCasts/inference/kt29767.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("kt4009.kt")
|
@TestMetadata("kt4009.kt")
|
||||||
public void testKt4009() throws Exception {
|
public void testKt4009() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/tests/smartCasts/inference/kt4009.kt");
|
runTest("compiler/testData/diagnostics/tests/smartCasts/inference/kt4009.kt");
|
||||||
|
|||||||
Generated
+5
@@ -19819,6 +19819,11 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing
|
|||||||
runTest("compiler/testData/diagnostics/tests/smartCasts/inference/kt2851.kt");
|
runTest("compiler/testData/diagnostics/tests/smartCasts/inference/kt2851.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt29767.kt")
|
||||||
|
public void testKt29767() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/smartCasts/inference/kt29767.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("kt4009.kt")
|
@TestMetadata("kt4009.kt")
|
||||||
public void testKt4009() throws Exception {
|
public void testKt4009() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/tests/smartCasts/inference/kt4009.kt");
|
runTest("compiler/testData/diagnostics/tests/smartCasts/inference/kt4009.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user