Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/kt2865.fir.kt
T
2021-04-09 12:32:45 +03:00

13 lines
355 B
Kotlin
Vendored

// !WITH_NEW_INFERENCE
operator fun <K, V> MutableMap<K, V>.set(k: K, v: V) {}
fun foo(a: MutableMap<String, String>, x: String?) {
a[x!!] = x
a[x] = x<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
}
fun foo1(a: MutableMap<String, String>, x: String?) {
<!INAPPLICABLE_CANDIDATE!>a[x]<!> = x!!
a[x<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>] = x
}