KT-5773 Smart cast doesn't work with Nothing on the rhs of "?:"

#KT-5773 FIxed
This commit is contained in:
Andrey Breslav
2014-09-15 18:24:13 +04:00
parent 3a806713fd
commit f1cf446e10
3 changed files with 21 additions and 0 deletions
@@ -0,0 +1,11 @@
class C {
fun foo() {}
}
fun test(a: C?, nn: () -> Nothing?) {
a ?: nn()
a<!UNSAFE_CALL!>.<!>foo()
a ?: return
<!DEBUG_INFO_AUTOCAST!>a<!>.foo()
}