Tests for KT-2865. Passes already in M11 or even earlier
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
fun <K, V> MutableMap<K, V>.set(k: K, v: V) {}
|
||||
|
||||
fun foo(a: MutableMap<String, String>, x: String?) {
|
||||
a[x!!] = <!DEBUG_INFO_SMARTCAST!>x<!>
|
||||
a[<!DEBUG_INFO_SMARTCAST!>x<!>] = x<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
|
||||
}
|
||||
|
||||
fun foo1(a: MutableMap<String, String>, x: String?) {
|
||||
<!TYPE_INFERENCE_CONFLICTING_SUBSTITUTIONS!>a[x]<!> = x!!
|
||||
a[x<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>] = <!DEBUG_INFO_SMARTCAST!>x<!>
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package
|
||||
|
||||
internal fun foo(/*0*/ a: kotlin.MutableMap<kotlin.String, kotlin.String>, /*1*/ x: kotlin.String?): kotlin.Unit
|
||||
internal fun foo1(/*0*/ a: kotlin.MutableMap<kotlin.String, kotlin.String>, /*1*/ x: kotlin.String?): kotlin.Unit
|
||||
internal fun </*0*/ K, /*1*/ V> kotlin.MutableMap<K, V>.set(/*0*/ k: K, /*1*/ v: V): kotlin.Unit
|
||||
@@ -11323,6 +11323,12 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/tests/smartCasts/varnotnull"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("kt2865.kt")
|
||||
public void testKt2865() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/smartCasts/varnotnull/kt2865.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt3224.kt")
|
||||
public void testKt3224() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/smartCasts/varnotnull/kt3224.kt");
|
||||
|
||||
Reference in New Issue
Block a user