| library; |
| import self as self; |
| |
| static method main() → dynamic { |
| dynamic closure; |
| { |
| Vector #context = MakeVector(3); |
| #context[2] = 0; |
| dynamic fn = MakeClosure<() → dynamic>(self::closure#main#function, #context); |
| for (; (#context[2]).<(3); #context = CopyVector(#context), #context[2] = (#context[2]).+(1)) { |
| #context[2] = (#context[2]).+(1); |
| closure = fn; |
| } |
| } |
| dynamic x = closure.call(); |
| if(!x.==(1)) { |
| throw "Expected 1, but got ${x}."; |
| } |
| } |
| static method closure#main#function(Vector #contextParameter) → dynamic { |
| return #contextParameter[2]; |
| } |