Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/variables/property.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

11 lines
196 B
Kotlin
Vendored

// !WITH_NEW_INFERENCE
class MyClass(var p: String?)
fun bar(s: String): Int {
return s.length
}
fun foo(m: MyClass): Int {
m.p = "xyz"
return <!INAPPLICABLE_CANDIDATE!>bar<!>(m.p)
}