Pattern matching: work-around for smart cast target type instability #KT-14705 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
bc0550d7b7
commit
b53ebd115b
+14
@@ -0,0 +1,14 @@
|
||||
package test2
|
||||
|
||||
<info descr="null">enum</info> class En { A, B, С }
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val en2: Any? = En.A
|
||||
if (en2 is En) {
|
||||
when (<info descr="Smart cast to test2.En">en2</info>) {
|
||||
En.A -> {}
|
||||
En.B -> {}
|
||||
En.С -> {}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user