Add test cases

issue-912 is xfailed. issue-2111 is already fixed, but it's good to
have the test case.
This commit is contained in:
Tim Chevalier 2012-06-21 19:58:52 -07:00
parent be8a08b2af
commit b8710de5ff
2 changed files with 19 additions and 0 deletions

View file

@ -0,0 +1,11 @@
fn foo(a: option<uint>, b: option<uint>) {
alt (a,b) { //! ERROR: non-exhaustive patterns: none not covered
(some(a), some(b)) if a == b { }
(some(_), none) |
(none, some(_)) { }
}
}
fn main() {
foo(none, none);
}

View file

@ -0,0 +1,8 @@
// xfail-test
fn find<T>(_f: fn(@T) -> bool, _v: [@T]) {}
fn main() {
let x = 10, arr = [];
find({|f| f.id == x}, arr);
arr += [{id: 20}]; // This assigns a type to arr
}