Split testdata of #KT-25432 and #KT-29767

This commit is contained in:
Dmitriy Novozhilov
2019-02-07 14:35:33 +03:00
parent 49a42f9434
commit a4d6f72ad1
6 changed files with 27 additions and 11 deletions
@@ -1,18 +1,11 @@
// !WITH_NEW_INFERENCE
// ISSUE: KT-25432
class Data<T>(val s: T)
fun test_1(d: Data<out Any>) {
fun test(d: Data<out Any>) {
if (d.s is String) {
<!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
public fun test_1(/*0*/ d: Data<out kotlin.Any>): kotlin.Unit
public fun test_2(/*0*/ a: kotlin.collections.MutableList<out kotlin.Int?>?): kotlin.Unit
public fun test(/*0*/ d: Data<out kotlin.Any>): kotlin.Unit
public final class Data</*0*/ 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");
}
@TestMetadata("kt29767.kt")
public void testKt29767() throws Exception {
runTest("compiler/testData/diagnostics/tests/smartCasts/inference/kt29767.kt");
}
@TestMetadata("kt4009.kt")
public void testKt4009() throws Exception {
runTest("compiler/testData/diagnostics/tests/smartCasts/inference/kt4009.kt");
@@ -19819,6 +19819,11 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing
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")
public void testKt4009() throws Exception {
runTest("compiler/testData/diagnostics/tests/smartCasts/inference/kt4009.kt");