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

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

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