summary refs log tree commit diff
path: root/src/test/run-pass/alt-join.rs
blob: 60ddb99c26a71dd2269093b516bde348aaef7229 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

use std;
import option;

fn foo<T>(y: option<T>) {
    let mut x: int;
    let mut rs: [int] = [];
    /* tests that x doesn't get put in the precondition for the
       entire if expression */

    if true {
    } else { alt y { none::<T> { x = 17; } _ { x = 42; } } rs += [x]; }
    ret;
}

fn main() { #debug("hello"); foo::<int>(some::<int>(5)); }