aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-pass/alt-join.rs34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/test/run-pass/alt-join.rs b/src/test/run-pass/alt-join.rs
new file mode 100644
index 00000000..152fac5d
--- /dev/null
+++ b/src/test/run-pass/alt-join.rs
@@ -0,0 +1,34 @@
+use std;
+import std.option;
+import std.option.t;
+import std.option.none;
+import std.option.some;
+
+fn foo[T](&option.t[T] y) {
+ let int x;
+
+ let vec[int] res = vec();
+
+ /* tests that x doesn't get put in the precondition for the
+ entire if expression */
+ if (true) {
+ }
+ else {
+ alt (y) {
+ case (none[T]) {
+ x = 17;
+ }
+ case (_) {
+ x = 42;
+ }
+ }
+ res += vec(x);
+ }
+
+ ret;
+}
+
+fn main() {
+ log("hello");
+ foo[int](some[int](5));
+} \ No newline at end of file