2011-07-05 21:57:34 -05:00
|
|
|
// Tests that trans_path checks whether a
|
|
|
|
// pattern-bound var is an upvar (when translating
|
|
|
|
// the for-each body)
|
|
|
|
use std;
|
|
|
|
import std::option::*;
|
|
|
|
import std::uint;
|
|
|
|
|
2011-07-27 07:19:39 -05:00
|
|
|
fn foo(src: uint) {
|
2011-07-05 21:57:34 -05:00
|
|
|
|
2011-07-27 07:19:39 -05:00
|
|
|
|
|
|
|
alt some(src) {
|
|
|
|
some(src_id) {
|
|
|
|
for each i: uint in uint::range(0u, 10u) {
|
|
|
|
let yyy = src_id;
|
2011-07-05 21:57:34 -05:00
|
|
|
assert (yyy == 0u);
|
|
|
|
}
|
2011-07-27 07:19:39 -05:00
|
|
|
}
|
|
|
|
_ { }
|
2011-07-05 21:57:34 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-07-27 07:19:39 -05:00
|
|
|
fn main() { foo(0u); }
|