about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorTim Chevalier <chevalier@alum.wellesley.edu>2011-08-26 00:46:53 -0700
committerTim Chevalier <chevalier@alum.wellesley.edu>2011-08-26 00:46:53 -0700
commit844e2d7d1cff43bd4f7ace853af8d09ff15e5ab5 (patch)
treee130bec88faad321a847c33b0e343b0b92612a74 /src
parent26e1cacb216fc754650a58b22bbbd91ab945089d (diff)
downloadrust-844e2d7d1cff43bd4f7ace853af8d09ff15e5ab5.tar.gz
rust-844e2d7d1cff43bd4f7ace853af8d09ff15e5ab5.zip
Test case for checks on pattern-bound vars
Diffstat (limited to 'src')
-rw-r--r--src/test/run-pass/check-pattern-bound.rs16
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"; }
+    }
+}