Evaluator: Support when expressions (EA-119639)

This commit is contained in:
Yan Zhulanow
2018-07-02 16:26:20 +03:00
parent c749a222eb
commit a2fdf7d47d
6 changed files with 63 additions and 28 deletions
@@ -0,0 +1,10 @@
package whenEvaluation
fun main(args: Array<String>) {
val a = "x"
//Breakpoint!
args.size
}
// EXPRESSION: when (a) { "a" -> "A"; "b" -> "B"; else -> "C" }
// RESULT: "C": Ljava/lang/String;
@@ -0,0 +1,8 @@
LineBreakpoint created at whenEvaluation.kt:6
Run Java
Connected to the target VM
whenEvaluation.kt:6
Compile bytecode for when (a) { "a" -> "A"; "b" -> "B"; else -> "C" }
Disconnected from the target VM
Process finished with exit code 0