PageRenderTime 16ms CodeModel.GetById 4ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 0ms

/src/test/compile-fail/pattern-tyvar-2.rs

http://github.com/jruderman/rust
Rust | 13 lines | 6 code | 5 blank | 2 comment | 0 complexity | 5b1076cd14622d31eedc6f67adba3c30 MD5 | raw file
 1// -*- rust -*-
 2
 3use std;
 4import option;
 5import option::some;
 6
 7// error-pattern: mismatched types
 8
 9enum bar { t1((), option<~[int]>), t2, }
10
11fn foo(t: bar) -> int { match t { t1(_, some(x)) => { return x * 3; } _ => { fail; } } }
12
13fn main() { }