blob: 734f46c56de1b22152b28b9877e433cf50053e32 [file] [log] [blame]
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];
}