summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/transform/UnCurry.scala11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/UnCurry.scala b/src/compiler/scala/tools/nsc/transform/UnCurry.scala
index 7f220992a3..f01cbade18 100644
--- a/src/compiler/scala/tools/nsc/transform/UnCurry.scala
+++ b/src/compiler/scala/tools/nsc/transform/UnCurry.scala
@@ -568,7 +568,12 @@ abstract class UnCurry extends InfoTransform
if ((sym ne null) && (sym.elisionLevel.exists (_ < settings.elidebelow.value || settings.noassertions.value)))
replaceElidableTree(tree)
else translateSynchronized(tree) match {
- case dd @ DefDef(mods, name, tparams, vparamss, tpt, rhs) =>
+ case dd @ DefDef(mods, name, tparams, _, tpt, rhs) =>
+ // Remove default argument trees from parameter ValDefs, SI-4812
+ val vparamssNoRhs = dd.vparamss mapConserve (_ mapConserve {p =>
+ treeCopy.ValDef(p, p.mods, p.name, p.tpt, EmptyTree)
+ })
+
if (dd.symbol hasAnnotation VarargsClass) saveRepeatedParams(dd)
withNeedLift(false) {
@@ -586,10 +591,10 @@ abstract class UnCurry extends InfoTransform
}
treeCopy.DefDef(
dd, mods, name, transformTypeDefs(tparams),
- transformValDefss(vparamss), transform(tpt), rhs1)
+ transformValDefss(vparamssNoRhs), transform(tpt), rhs1)
}
} else {
- super.transform(dd)
+ super.transform(treeCopy.DefDef(dd, mods, name, tparams, vparamssNoRhs, tpt, rhs))
}
}
case ValDef(_, _, _, rhs) =>