backend: fix minor bug in evaluateWhen
Also add the corresponding test 'when9'.
This commit is contained in:
committed by
SvyatoslavScherbina
parent
0958d32605
commit
1f7738e052
@@ -330,6 +330,11 @@ task when8(type: RunKonanTest) {
|
||||
goldValue = "true\n"
|
||||
}
|
||||
|
||||
task when9(type: RunKonanTest) {
|
||||
goldValue = "Ok\n"
|
||||
source = "codegen/branching/when9.kt"
|
||||
}
|
||||
|
||||
task when_through(type: RunKonanTest) {
|
||||
source = "codegen/branching/when_through.kt"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
fun main(args: Array<String>) {
|
||||
foo(0)
|
||||
println("Ok")
|
||||
}
|
||||
|
||||
fun foo(x: Int) {
|
||||
when (x) {
|
||||
0 -> 0
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user