2011-05-26 18:02:25 -05:00
|
|
|
// -*- rust -*-
|
2011-08-12 17:42:39 -05:00
|
|
|
fn foo(c: [int]) {
|
2011-07-27 07:19:39 -05:00
|
|
|
let a: int = 5;
|
2011-08-19 17:16:48 -05:00
|
|
|
let b: [int] = [];
|
2011-05-26 18:02:25 -05:00
|
|
|
|
2011-07-27 07:19:39 -05:00
|
|
|
|
2011-08-13 02:10:18 -05:00
|
|
|
alt none::<int> {
|
2011-08-19 17:16:48 -05:00
|
|
|
some::<int>(_) { for i: int in c { log a; let a = 17; b += [a]; } }
|
|
|
|
_ { }
|
2011-05-26 18:02:25 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-08-12 08:37:25 -05:00
|
|
|
tag t<T> { none; some(T); }
|
2011-05-26 18:02:25 -05:00
|
|
|
|
2011-08-19 17:16:48 -05:00
|
|
|
fn main() { let x = 10; let x = x + 20; assert (x == 30); foo([]); }
|