diff options
| author | Tim Chevalier <chevalier@alum.wellesley.edu> | 2011-08-26 00:46:53 -0700 |
|---|---|---|
| committer | Tim Chevalier <chevalier@alum.wellesley.edu> | 2011-08-26 00:46:53 -0700 |
| commit | 844e2d7d1cff43bd4f7ace853af8d09ff15e5ab5 (patch) | |
| tree | e130bec88faad321a847c33b0e343b0b92612a74 /src/test | |
| parent | 26e1cacb216fc754650a58b22bbbd91ab945089d (diff) | |
| download | rust-844e2d7d1cff43bd4f7ace853af8d09ff15e5ab5.tar.gz rust-844e2d7d1cff43bd4f7ace853af8d09ff15e5ab5.zip | |
Test case for checks on pattern-bound vars
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/run-pass/check-pattern-bound.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/run-pass/check-pattern-bound.rs b/src/test/run-pass/check-pattern-bound.rs new file mode 100644 index 00000000000..0ebaf84b96d --- /dev/null +++ b/src/test/run-pass/check-pattern-bound.rs @@ -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"; } + } +} |
