Mark array constructors with 'inline'

To allow non-local returns from lambdas passed to them
This commit is contained in:
Alexander Udalov
2016-01-27 19:52:39 +03:00
parent 70e847b794
commit a02d1b75b8
9 changed files with 62 additions and 31 deletions
@@ -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"
}