Test case for checks on pattern-bound vars
This commit is contained in:
parent
26e1cacb21
commit
844e2d7d1c
1 changed files with 16 additions and 0 deletions
16
src/test/run-pass/check-pattern-bound.rs
Normal file
16
src/test/run-pass/check-pattern-bound.rs
Normal file
|
@ -0,0 +1,16 @@
|
|||
use std;
|
||||
import std::option::*;
|
||||
|
||||
pure fn p(x:int) -> bool { true }
|
||||
|
||||
fn f(x:int) : p(x) { }
|
||||
|
||||
fn main() {
|
||||
alt some(5) {
|
||||
some(y) {
|
||||
check p(y);
|
||||
f(y);
|
||||
}
|
||||
_ { fail "yuck"; }
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue