Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/kt2865.fir.kt
T
simon.ogorodnik 34e6649d31 [FIR] Harden check of argument type properly
Before this commit, nullable argument could match not null parameter.
Now we require also correct nullability that breaks some cases
2020-02-03 16:45:18 +03:00

12 lines
280 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!!
}
fun foo1(a: MutableMap<String, String>, x: String?) {
<!INAPPLICABLE_CANDIDATE!>a[x] = x!!<!>
a[x!!] = x
}