summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Typers.scala
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2013-01-05 00:52:48 +0300
committerEugene Burmako <xeno.by@gmail.com>2013-01-09 08:10:48 +0100
commit94de3c87edf420b4d1d8b495fd7976f4b515483d (patch)
treea950eff79a4b14e33655ad75741abfc96cae294b /src/compiler/scala/tools/nsc/typechecker/Typers.scala
parent3d397aa5e6381fa7514f3b5e160d170dad9d8f1c (diff)
downloadscala-94de3c87edf420b4d1d8b495fd7976f4b515483d.tar.gz
scala-94de3c87edf420b4d1d8b495fd7976f4b515483d.tar.bz2
scala-94de3c87edf420b4d1d8b495fd7976f4b515483d.zip
typedPrimaryConstrBody now returns supercall
Previously this method returned the entire block with supercall being potentially wrapped in early defs. However when implementing type macros, I found it more convenient to have typedPrimaryConstrBody to only return the supercall itself. This doesn't make any difference for our current codebase, since the only time anyone cares about the return value, it's only to inspect its tpe. Therefore I'm submitting this patch in a preparatory pull request to reduce the surface of changes in the upcoming type macros pull request.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index f0bb425884..0a653a3e15 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -1587,7 +1587,11 @@ trait Typers extends Modes with Adaptations with Tags {
else
map2(preSuperStats, preSuperVals)((ldef, gdef) => gdef.tpt setType ldef.symbol.tpe)
- if (superCall1 == cunit) EmptyTree else cbody2
+ if (superCall1 == cunit) EmptyTree
+ else cbody2 match {
+ case Block(_, expr) => expr
+ case tree => tree
+ }
case _ =>
EmptyTree
}