/src/test/compile-fail/pattern-tyvar.rs
http://github.com/jruderman/rust · Rust · 19 lines · 13 code · 4 blank · 2 comment · 1 complexity · 34fd992c283e65eb82c3cf465fe84788 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) {
- match t {
- t1(_, some::<int>(x)) => {
- log(debug, x);
- }
- _ => { fail; }
- }
- }
- fn main() { }