cfleming
04/18/2024, 10:29 PMval engine = ScriptEngineManager().getEngineByExtension("main.kts")!!
println(engine.eval("if (true) { 2 } else { 3 }"))
println(engine.eval("if (true) 2 else 3"))
This prints:
0
2
So the conditional returns an incorrect value if the then and else terms have braces around them. I’ve tested this with both the “main.kts” and “kts” engines, and with 1.9.23 and 2.0.0-RC1. Am I misunderstanding something about how this should work?