JS Back-end does not handle complex patterns any more

#KT-2359 In Progress
This commit is contained in:
Andrey Breslav
2012-09-05 12:53:48 +04:00
parent 4dd0b27e93
commit 1b65ba644e
9 changed files with 64 additions and 93 deletions
@@ -5,12 +5,12 @@ fun box() : Int {
val d = 5
var z = 0
when(c) {
is 5, is 3 -> z++;
5, 3 -> z++;
else -> {z = -1000;}
}
when(d) {
is 5, is 3 -> z++;
5, 3 -> z++;
else -> {z = -1000;}
}
return z
@@ -4,8 +4,8 @@ package foo
fun box() : Boolean {
return (when(1) {
is 2 -> 3
is 1 -> 1
2 -> 3
1 -> 1
else -> 5
} == 1)
@@ -1,11 +0,0 @@
package foo
fun box() : Boolean {
var a = 4
when(a) {
!is 3 -> {a = 10;}
!is 4 -> {a = 20;}
else -> {a = 30;}
}
return (a == 10)
}
@@ -3,8 +3,8 @@ package foo
fun box() : Boolean {
var a = 4
when(a) {
is 3 -> {a = 10;}
is 4 -> {a = 20;}
3 -> {a = 10;}
4 -> {a = 20;}
else -> {a = 30;}
}
return (a == 20)
@@ -13,13 +13,13 @@ fun box() : Boolean {
var a = A() : Any?
var b = null : Any?
when(a) {
is null -> c = 10;
null -> c = 10;
is B -> c = 10000
is A -> c = 20;
else -> c = 1000
}
when(b) {
is null -> c += 5
null -> c += 5
is B -> c += 100
else -> c = 1000
}