Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/alwaysNullWithJava.kt
T
Tianyu Geng 4726dcce40 FIR DFA: smartcast variable to Nothing? on null assignment
In order to make resolution still work for members not available from
`Nothing`, we track the type without `Nothing?` and use that for
resolution instead.
2021-08-06 22:57:15 +03:00

17 lines
253 B
Kotlin
Vendored

// FIR_IDENTICAL
// FILE: My.java
public class My {
static public My create() { return new My(); }
public void foo() {}
}
// FILE: Test.kt
fun test() {
val my = My.create()
if (my == null) {
my<!UNSAFE_CALL!>.<!>foo()
}
}