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