blob: 652b27b0a0912d9a1a0473fa14c01b94b20097f1 [file] [log] [blame]
library;
import self as self;
static method main() dynamic {
dynamic closure;
{
Vector #context = MakeVector(2);
#context[1] = 0;
dynamic fn = MakeClosure<() dynamic>(self::closure#main#function, #context);
for (; (#context[1]).<(3); #context = CopyVector(#context), #context[1] = (#context[1]).+(1)) {
#context[1] = (#context[1]).+(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[1];
}