JET-40 Check that 'else' entry is the last one in the list of 'when' entries
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user