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

6 lines
188 B
Kotlin
Vendored

fun Any?.foo(my: My) = my === this
class My(val x: Any)
// my is nullable in brackets because Any?.foo has nullable receiver
fun foo(my: My?) = my?.x.<!INAPPLICABLE_CANDIDATE!>foo<!>(my)