Switch when to phi. (#172)

This commit is contained in:
Nikolay Igotti
2016-12-29 16:33:23 +03:00
committed by GitHub
parent c15fb6833d
commit 667d3b9356
4 changed files with 46 additions and 30 deletions
+8
View File
@@ -279,6 +279,14 @@ task when5(type: RunKonanTest) {
source = "codegen/branching/when5.kt"
}
task when6(type: RunKonanTest) {
source = "codegen/branching/when6.kt"
}
task when7(type: RunKonanTest) {
source = "codegen/branching/when7.kt"
}
task when_through(type: RunKonanTest) {
source = "codegen/branching/when_through.kt"
}
@@ -0,0 +1,6 @@
fun foo() {
}
fun main(args: Array<String>) {
if (true) foo() else foo()
}
@@ -0,0 +1,4 @@
fun main(args: Array<String>) {
val b = args.size < 1
val x = if (b) Any() else throw Error()
}