Closed
Description
The following program ought to typecheck:
fn main() {
let e = @{mutable refs: ~[], n: 0};
lambda() { log_err e.n; };
e.refs += ~[1];
}
but is rejected with:
nubs/lambda-infer-fail.rs:5 log_err e.n;
This is because typechecking requires e to be fully resolved when it finishes typechecking the lambda. It shouldn't require this until it finishes typechecking the nearest enclosing non-capturing scope.