diff options
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/Constructors.scala | 2 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/LambdaLift.scala | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/Constructors.scala b/src/compiler/scala/tools/nsc/transform/Constructors.scala index f5eca11c98..aef2817db7 100644 --- a/src/compiler/scala/tools/nsc/transform/Constructors.scala +++ b/src/compiler/scala/tools/nsc/transform/Constructors.scala @@ -167,7 +167,7 @@ abstract class Constructors extends Statics with Transform with ast.TreeDSL { // no point traversing further once omittables is empty, all candidates ruled out already. object detectUsages extends Traverser { - lazy val bodyOfOuterAccessor = defs collect { case dd: DefDef if omittableOuterAcc(dd.symbol) => dd.symbol -> dd.rhs } toMap + lazy val bodyOfOuterAccessor = defs.collect{ case dd: DefDef if omittableOuterAcc(dd.symbol) => dd.symbol -> dd.rhs }.toMap override def traverse(tree: Tree): Unit = if (omittables.nonEmpty) { diff --git a/src/compiler/scala/tools/nsc/transform/LambdaLift.scala b/src/compiler/scala/tools/nsc/transform/LambdaLift.scala index 01714e22fd..a943b53bf7 100644 --- a/src/compiler/scala/tools/nsc/transform/LambdaLift.scala +++ b/src/compiler/scala/tools/nsc/transform/LambdaLift.scala @@ -398,7 +398,7 @@ abstract class LambdaLift extends InfoTransform { case DefDef(_, _, _, vparams :: _, _, _) => val ps = freeParams(sym) - if (ps isEmpty) tree + if (ps.isEmpty) tree else { val paramSyms = cloneSymbols(ps).map(_.setFlag(PARAM)) val paramDefs = ps map (p => ValDef(p) setPos tree.pos setType NoType) @@ -410,7 +410,7 @@ abstract class LambdaLift extends InfoTransform { case ClassDef(_, _, _, _) => val freeParamDefs = freeParams(sym) map (p => ValDef(p) setPos tree.pos setType NoType) - if (freeParamDefs isEmpty) tree + if (freeParamDefs.isEmpty) tree else deriveClassDef(tree)(impl => deriveTemplate(impl)(_ ::: freeParamDefs)) case _ => tree |