summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2012-11-13 11:21:17 +0100
committerJason Zaugg <jzaugg@gmail.com>2012-11-13 18:40:30 +0100
commitb9e3ea7f070806631fd318e43082bc0653a79410 (patch)
tree178c70bda0a06a6f828738196b27dbaf6ac0c76d /test
parent8b2caf0746fd4405f2d47b54d17d484e6603c89d (diff)
downloadscala-b9e3ea7f070806631fd318e43082bc0653a79410.tar.gz
scala-b9e3ea7f070806631fd318e43082bc0653a79410.tar.bz2
scala-b9e3ea7f070806631fd318e43082bc0653a79410.zip
SI-6646 `ident` or Ident is always new binding.
The previous commit regressed in these cases: // 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`) At the top level of the LHS of a <-, such identifiers represent new bindings, not stable identifier patterns.
Diffstat (limited to 'test')
-rw-r--r--test/files/run/t6646.check2
-rw-r--r--test/files/run/t6646.scala6
2 files changed, 8 insertions, 0 deletions
diff --git a/test/files/run/t6646.check b/test/files/run/t6646.check
index e27b5b9efb..b0b7ad32f3 100644
--- a/test/files/run/t6646.check
+++ b/test/files/run/t6646.check
@@ -1,3 +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
index 9418bfafb1..150b0df11e 100644
--- a/test/files/run/t6646.scala
+++ b/test/files/run/t6646.scala
@@ -6,8 +6,14 @@ 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`)
}
}