Put not-null original type as last possible smart cast target
This fixes muted tests testSmartCast (IDE highlighting) and
testNestedSealed (Diagnostics).
Together with commit 555b3f12 this makes #KT-15901 Fixed
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
// See KT-15901
|
||||
|
||||
<info>enum</info> class En { A }
|
||||
|
||||
fun foo(): Any {
|
||||
val en2: Any? = En.A
|
||||
if (en2 is En) {
|
||||
// Here we had smart casts to En / Any
|
||||
// should be always En
|
||||
val a: Any = <info descr="Smart cast to En">en2</info>
|
||||
return a
|
||||
}
|
||||
return ""
|
||||
}
|
||||
Reference in New Issue
Block a user