From 8b2caf0746fd4405f2d47b54d17d484e6603c89d Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Sat, 10 Nov 2012 13:07:26 +0100 Subject: SI-6646 Fix regression in for desugaring. The early check in the parser of pattern irrefutability, added in c82ecab, failed to consider InitCaps and `backquoted` identifiers. --- test/files/run/t6646.check | 3 +++ test/files/run/t6646.scala | 13 +++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 test/files/run/t6646.check create mode 100644 test/files/run/t6646.scala (limited to 'test') diff --git a/test/files/run/t6646.check b/test/files/run/t6646.check new file mode 100644 index 0000000000..e27b5b9efb --- /dev/null +++ b/test/files/run/t6646.check @@ -0,0 +1,3 @@ +Found NotNull +Found lower +Found 2 diff --git a/test/files/run/t6646.scala b/test/files/run/t6646.scala new file mode 100644 index 0000000000..9418bfafb1 --- /dev/null +++ b/test/files/run/t6646.scala @@ -0,0 +1,13 @@ +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) + for (option @ NotNull <- l) println("Found " + option) + for (option @ `lower` <- l) println("Found " + option) + for ((`lower`, i) <- l.zipWithIndex) println("Found " + i) + } +} -- cgit v1.2.3