summaryrefslogtreecommitdiff
path: root/test/files/run/t3353.scala
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@epfl.ch>2013-01-31 22:51:03 +0100
committerLukas Rytz <lukas.rytz@epfl.ch>2013-01-31 23:01:22 +0100
commit104943572e77427bf3b2efcff73033bf20e8db9b (patch)
tree7064d8218cb01a5369f85b4fb1204a306227b7f0 /test/files/run/t3353.scala
parentc4f49759fe8f15e25174232abe566ad292d2e5e8 (diff)
downloadscala-104943572e77427bf3b2efcff73033bf20e8db9b.tar.gz
scala-104943572e77427bf3b2efcff73033bf20e8db9b.tar.bz2
scala-104943572e77427bf3b2efcff73033bf20e8db9b.zip
SI-3353 don't extract <unapply-selector> into named-arg local val
This already fixes all of SI-3353 because no named-args-block is generated anymore (they are avoided if they have a single expr). So the same NPE in extractorFormalTypes as described in the ticket is no longer triggered. I think that's all there is to fix, since extractor patterns are translated to unapply calls with one argument, i think it's not possible to write a pattern that would result in a named-apply block.
Diffstat (limited to 'test/files/run/t3353.scala')
-rw-r--r--test/files/run/t3353.scala10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/files/run/t3353.scala b/test/files/run/t3353.scala
new file mode 100644
index 0000000000..eeb63c1b05
--- /dev/null
+++ b/test/files/run/t3353.scala
@@ -0,0 +1,10 @@
+object Test extends App {
+
+ "foo" match {
+ case Matcher(result) => println(result)
+ }
+
+ object Matcher{
+ def unapply(s: String)(implicit secondParam: Option[String] = None) = Some("Got: " + s + " and " + secondParam)
+ }
+}