Files
kotlin-fork/compiler/testData/diagnostics/tests/when/ReservedExhaustiveWhen.kt
T
2015-12-18 21:20:54 +03:00

37 lines
640 B
Kotlin
Vendored

// !DIAGNOSTICS: -UNUSED_PARAMETER
infix fun Any.sealed(a: Any?) {}
val x = 1 <!UNSUPPORTED!>sealed<!> when (1) {
1 -> 1
else -> 2
}
val x1 = 1 <!UNSUPPORTED!>sealed<!> /**/ when (1) {
1 -> 1
else -> 2
}
fun foo() {
<!UNRESOLVED_REFERENCE, UNSUPPORTED!>sealed<!><!SYNTAX!><!> when {
else -> {}
}
1 <!UNSUPPORTED!>sealed<!> when {
else -> {}
}
1 sealed (when {
else -> {}
})
<!UNUSED_EXPRESSION!>1<!>
<!UNRESOLVED_REFERENCE, UNSUPPORTED!>sealed<!><!SYNTAX!><!> when {
else -> {}
}
1 <!UNSUPPORTED!>sealed<!>
when {
else -> {}
}
}