summary refs log tree commit diff
path: root/src/test/run-pass/shadow.rs
blob: c01cc5502602ae4ee75c3687cbb2d985d16cb62e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// -*- rust -*-
fn foo(c: ~[int]) {
    let a: int = 5;
    let mut b: ~[int] = ~[];


    match none::<int> {
      some::<int>(_) => {
        for c.each |i| {
            log(debug, a);
            let a = 17;
            b += ~[a];
        }
      }
      _ => { }
    }
}

enum t<T> { none, some(T), }

fn main() { let x = 10; let x = x + 20; assert (x == 30); foo(~[]); }