diff options
author | Lukas Rytz <lukas.rytz@epfl.ch> | 2013-01-31 22:51:03 +0100 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@epfl.ch> | 2013-01-31 23:01:22 +0100 |
commit | 104943572e77427bf3b2efcff73033bf20e8db9b (patch) | |
tree | 7064d8218cb01a5369f85b4fb1204a306227b7f0 /test/files | |
parent | c4f49759fe8f15e25174232abe566ad292d2e5e8 (diff) | |
download | scala-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')
-rw-r--r-- | test/files/run/t3353.check | 1 | ||||
-rw-r--r-- | test/files/run/t3353.scala | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/test/files/run/t3353.check b/test/files/run/t3353.check new file mode 100644 index 0000000000..8b4ae1fe69 --- /dev/null +++ b/test/files/run/t3353.check @@ -0,0 +1 @@ +Got: foo and None 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) + } +} |