[NI] Fix reporting smartcast diagnostics for intersection types

#KT-30826 Fixed
This commit is contained in:
Dmitriy Novozhilov
2019-04-08 12:37:56 +03:00
parent 47b1ea7fa4
commit 033d7262a2
15 changed files with 115 additions and 36 deletions
@@ -0,0 +1,19 @@
// !WITH_NEW_INFERENCE
// Issue: KT-30826
interface I1
interface I2 {
fun foo() {}
}
class A : I1, I2
fun foo(x: I1?) {
var y = x
y as I2
val bar = {
<!SMARTCAST_IMPOSSIBLE!>y<!>.foo() // NPE in NI, smartcast impossible in OI
}
y = null
bar()
}