KT-234 Force when() expressions to have an 'else' branch

KT-973 Unreachable code
This commit is contained in:
svtk
2012-01-18 13:31:42 +04:00
parent 94e3cc9976
commit becd713111
23 changed files with 175 additions and 50 deletions
@@ -6,7 +6,7 @@ fun notAnExpression() {
any(<!SUPER_IS_NOT_AN_EXPRESSION!>super<!>) // not an expression
if (<!SUPER_IS_NOT_AN_EXPRESSION!>super<!>) {} else {} // not an expression
val <!UNUSED_VARIABLE!>x<!> = <!SUPER_IS_NOT_AN_EXPRESSION!>super<!> // not an expression
when (1) {
<!NO_ELSE_IN_WHEN!>when<!> (1) {
<!SUPER_IS_NOT_AN_EXPRESSION!>super<!> -> 1 // not an expression
}
@@ -86,4 +86,4 @@ class A1 {
fun test() {
<!SUPER_IS_NOT_AN_EXPRESSION!>super<!>.equals(null)
}
}
}