CODE_INVOCATION_FAILED
Called block with too few arguments.
Got: 0 Expected: 1.
Target:
testList.<block>.<block> test.toit:32:24
catch:
catch: | x y | ...
testList:
DATA ::= [1,2]
2.repeat: // works
d := DATA[it]
print "$it: $d"
2.repeat:
d := null
e := catch --trace : d = DATA[it]
print "$it: $d"
it
2.repeat: | index | catch --trace: DATA[index]
catch:
it
main:
testList
testList:
DATA ::= [1,2]
// force out of bounds error - but catch it
3.repeat: | index |
d := null
e := catch : d = DATA[index]
print "$index: $d"
it
catch:
it
catch:
index
catch:
index
repeat:
it