2011-05-14 19:03:08 -07:00
|
|
|
// -*- rust -*-
|
2012-12-10 17:32:48 -08:00
|
|
|
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
2012-09-11 17:46:20 -07:00
|
|
|
extern mod std;
|
2012-09-05 12:32:05 -07:00
|
|
|
use option::Some;
|
2011-05-14 19:03:08 -07:00
|
|
|
|
|
|
|
// error-pattern: mismatched types
|
|
|
|
|
2012-08-20 12:23:37 -07:00
|
|
|
enum bar { t1((), Option<~[int]>), t2, }
|
2011-05-14 19:03:08 -07:00
|
|
|
|
2011-12-22 14:42:52 -08:00
|
|
|
fn foo(t: bar) {
|
2012-08-06 12:34:08 -07:00
|
|
|
match t {
|
2012-08-20 12:23:37 -07:00
|
|
|
t1(_, Some::<int>(x)) => {
|
2011-12-22 17:53:53 -08:00
|
|
|
log(debug, x);
|
2011-12-22 14:42:52 -08:00
|
|
|
}
|
2012-08-03 19:59:04 -07:00
|
|
|
_ => { fail; }
|
2011-12-22 14:42:52 -08:00
|
|
|
}
|
|
|
|
}
|
2011-05-14 19:03:08 -07:00
|
|
|
|
2011-08-10 09:27:22 -07:00
|
|
|
fn main() { }
|