CODE_INVOCATION_FAILED
Called block with too few arguments.
Got: 0 Expected: 1.
Target:
testList.<block>.<block> test.toit:32:24catch: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"it2.repeat: | index | catch --trace: DATA[index]catch:itmain:
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"itcatch:itcatch:indexcatch:indexrepeat:it