JET-40 Check that 'else' entry is the last one in the list of 'when' entries

This commit is contained in:
Andrey Breslav
2011-05-21 13:30:58 +04:00
parent be31946f4a
commit caad86e880
2 changed files with 18 additions and 1 deletions
+10
View File
@@ -14,6 +14,7 @@ fun foo() {
.<error>a</error> => 1
.equals(1).<error>a</error> => 1
<warning>?.</warning>equals(1) => 1
else => 1
}
when (<warning>x</warning>?:null) {
<error>.</error>equals(1) => 1
@@ -46,6 +47,15 @@ fun test() {
is boo @ (1, <error>"a"</error>, *) => 1
is boo @ <error>(1, *)</error> => 1
}
when (z) {
<error>else => 1</error>
(1, 1) => 2
}
when (z) {
else => 1
}
}
val (Int, Int).boo : (Int, Int, Int) = (1, 1, 1)