2011-09-01 07:35:00 -05:00
|
|
|
// error-pattern:assigning to upvar
|
2011-08-04 21:31:47 -05:00
|
|
|
// Make sure we can't write to upvars from lambdas
|
|
|
|
fn main() {
|
|
|
|
let i = 0;
|
2011-08-19 17:16:48 -05:00
|
|
|
let ctr = lambda () -> int { i = i + 1; ret i; };
|
2011-12-22 16:42:52 -06:00
|
|
|
log_full(core::error, ctr());
|
|
|
|
log_full(core::error, ctr());
|
|
|
|
log_full(core::error, ctr());
|
|
|
|
log_full(core::error, ctr());
|
|
|
|
log_full(core::error, ctr());
|
|
|
|
log_full(core::error, i);
|
2011-08-04 21:31:47 -05:00
|
|
|
}
|