summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@epfl.ch>2012-04-26 15:29:07 +0200
committerAdriaan Moors <adriaan.moors@epfl.ch>2012-04-26 15:29:07 +0200
commitefd1293df967a10211ca877130f97955be94dc30 (patch)
tree057938c424517a86a1d06cf65fbc9c0b8bc118d3 /src
parent8fc543b5dd7e6a8fa1827cc9e9d65e721cae140e (diff)
downloadscala-efd1293df967a10211ca877130f97955be94dc30.tar.gz
scala-efd1293df967a10211ca877130f97955be94dc30.tar.bz2
scala-efd1293df967a10211ca877130f97955be94dc30.zip
SI-5690: no-selector match in function yields function
the implicit beta-reduction performed by typedFunction on a Function(.., Match(EmptyTree, ...)) must of course only be done when the selector actually is empty... (yes, typedMatchAnonFun needs to be cleaned up, I know)
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index 934a7567d5..e4c3dcfa55 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -2439,7 +2439,7 @@ trait Typers extends Modes with Adaptations with Taggings with PatMatVirtualiser
fun.body match {
// later phase indicates scaladoc is calling (where shit is messed up, I tell you)
// -- so fall back to old patmat, which is more forgiving
- case Match(sel, cases) if doMatchTranslation =>
+ case Match(sel, cases) if (sel ne EmptyTree) && doMatchTranslation =>
// go to outer context -- must discard the context that was created for the Function since we're discarding the function
// thus, its symbol, which serves as the current context.owner, is not the right owner
// you won't know you're using the wrong owner until lambda lift crashes (unless you know better than to use the wrong owner)