diff options
author | Paul Phillips <paulp@improving.org> | 2011-05-06 16:34:10 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-05-06 16:34:10 +0000 |
commit | 9654d5149166464987b7f8aa6c6d2cae8cbb3ae6 (patch) | |
tree | bc6c03fe867588087e28144c9fe13a976748fdab /test/files | |
parent | a6d0d9dd0de962147b184b39c2169c2d47673cd8 (diff) | |
download | scala-9654d5149166464987b7f8aa6c6d2cae8cbb3ae6.tar.gz scala-9654d5149166464987b7f8aa6c6d2cae8cbb3ae6.tar.bz2 scala-9654d5149166464987b7f8aa6c6d2cae8cbb3ae6.zip |
Tightened a condition to avoid a self-referenti...
Tightened a condition to avoid a self-referential pattern variable
crash. Closes #3392, no review.
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/neg/bug3392.check | 4 | ||||
-rw-r--r-- | test/files/neg/bug3392.scala | 11 |
2 files changed, 15 insertions, 0 deletions
diff --git a/test/files/neg/bug3392.check b/test/files/neg/bug3392.check new file mode 100644 index 0000000000..cbae73ad3a --- /dev/null +++ b/test/files/neg/bug3392.check @@ -0,0 +1,4 @@ +bug3392.scala:9: error: not found: value x + case x@A(x/*<-- refers to the pattern that includes this comment*/.Ex(42)) => + ^ +one error found diff --git a/test/files/neg/bug3392.scala b/test/files/neg/bug3392.scala new file mode 100644 index 0000000000..655c2e84a3 --- /dev/null +++ b/test/files/neg/bug3392.scala @@ -0,0 +1,11 @@ +object Test { + case class A(a: Int) { + object Ex { + def unapply(i: Int): Option[Int] = Some(i) + } + } + + A(42) match { + case x@A(x/*<-- refers to the pattern that includes this comment*/.Ex(42)) => + } +} |