From 94de3c87edf420b4d1d8b495fd7976f4b515483d Mon Sep 17 00:00:00 2001 From: Eugene Burmako Date: Sat, 5 Jan 2013 00:52:48 +0300 Subject: 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. --- src/compiler/scala/tools/nsc/typechecker/Typers.scala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') 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 } -- cgit v1.2.3