Mark array constructors with 'inline'
To allow non-local returns from lambdas passed to them
This commit is contained in:
+21
@@ -0,0 +1,21 @@
|
||||
fun testArray() {
|
||||
Array<String>(5) { i ->
|
||||
if (i == 3) return
|
||||
i.toString()
|
||||
}
|
||||
throw AssertionError()
|
||||
}
|
||||
|
||||
fun testIntArray() {
|
||||
IntArray(5) { i ->
|
||||
if (i == 3) return
|
||||
i
|
||||
}
|
||||
throw AssertionError()
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
testArray()
|
||||
testIntArray()
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user