summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2012-11-13 15:41:45 -0800
committerAdriaan Moors <adriaan.moors@typesafe.com>2012-11-13 15:41:45 -0800
commitea87ecbe818f7445156d6c2548e429a8ca54595d (patch)
treebd22ab5b263953982d0028da8f49efd671d8d18d /test
parent8b598436f64ca4e980c8a38f642085b4d23e2327 (diff)
parent45cf745ccfe5b3729be70dee604beb0b7b411faf (diff)
downloadscala-ea87ecbe818f7445156d6c2548e429a8ca54595d.tar.gz
scala-ea87ecbe818f7445156d6c2548e429a8ca54595d.tar.bz2
scala-ea87ecbe818f7445156d6c2548e429a8ca54595d.zip
Merge pull request #1606 from retronym/ticket/6646
SI-6646 Fix regression in for desugaring.
Diffstat (limited to 'test')
-rw-r--r--test/files/run/t6646.check5
-rw-r--r--test/files/run/t6646.scala19
2 files changed, 24 insertions, 0 deletions
diff --git a/test/files/run/t6646.check b/test/files/run/t6646.check
new file mode 100644
index 0000000000..b0b7ad32f3
--- /dev/null
+++ b/test/files/run/t6646.check
@@ -0,0 +1,5 @@
+Found NotNull
+Found lower
+Found 2
+A single ident is always a pattern
+A single ident is always a pattern
diff --git a/test/files/run/t6646.scala b/test/files/run/t6646.scala
new file mode 100644
index 0000000000..150b0df11e
--- /dev/null
+++ b/test/files/run/t6646.scala
@@ -0,0 +1,19 @@
+sealed trait ColumnOption
+case object NotNull extends ColumnOption
+case object PrimaryKey extends ColumnOption
+case object lower extends ColumnOption
+
+object Test {
+ def main(args: Array[String]) {
+ val l = List(PrimaryKey, NotNull, lower)
+
+ // withFilter must be generated in these
+ for (option @ NotNull <- l) println("Found " + option)
+ for (option @ `lower` <- l) println("Found " + option)
+ for ((`lower`, i) <- l.zipWithIndex) println("Found " + i)
+
+ // no withFilter
+ for (X <- List("A single ident is always a pattern")) println(X)
+ for (`x` <- List("A single ident is always a pattern")) println(`x`)
+ }
+}