blob: dd1dffc77b422fd1c3d0b2846c12b13458bbc3db [file] [log] [blame]
library;
import self as self;
static method main() dynamic {
dynamic closure;
{
dynamic #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(dynamic #contextParameter) → dynamic {
return #contextParameter[2];
}