Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/kt27221.fir.kt
T
2021-05-05 18:20:51 +03:00

29 lines
460 B
Kotlin
Vendored

// !DIAGNOSTICS: -UNUSED_VARIABLE
// SKIP_TXT
sealed class A
sealed class B : A()
sealed class C : B()
object BB : B()
object CC : C()
fun foo(a: A) {
if (a is B) {
if (a is C) {
val t = when (a) {
is CC -> "CC"
}
}
}
}
fun foo2(a: A) {
if (a is C) {
if (<!USELESS_IS_CHECK!>a is B<!>) {
val t = when (a) {
is CC -> "CC"
}
}
}
}