'sealed' reserved in front of when

This commit is contained in:
Andrey Breslav
2015-12-17 20:30:12 +03:00
parent c36eeadab1
commit 75ab0dd509
7 changed files with 81 additions and 1 deletions
@@ -0,0 +1,37 @@
// !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 -> {}
}
}
@@ -0,0 +1,6 @@
package
public val x: kotlin.Unit
public val x1: kotlin.Unit
public fun foo(): kotlin.Unit
public infix fun kotlin.Any.sealed(/*0*/ a: kotlin.Any?): kotlin.Unit