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


    alt none::<int> {
      some::<int>(_) { for i: int in c { log a; let a = 17; b += [a]; } }
      _ { }
    }
}

tag t<T> { none; some(T); }

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