Using invokeFunction() instead of invokeFunctionWithNoParams() when generating when() conditions
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
var x = 0
|
||||
fun inc(): Int {
|
||||
x++
|
||||
return 0
|
||||
}
|
||||
fun box(): String {
|
||||
val al = java.util.ArrayList<Int>()
|
||||
when (inc()) {
|
||||
in al -> return "fail 1"
|
||||
else -> {}
|
||||
}
|
||||
return if (x == 1) "OK" else "fail 2"
|
||||
}
|
||||
Reference in New Issue
Block a user