Skip to content

Commit 3ed3ba0

Browse files
committed
Hack, but does not work
1 parent fe28a45 commit 3ed3ba0

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

compiler/src/dotty/tools/dotc/ast/Desugar.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ object desugar {
406406
def paramssNoRHS = mapParamss(meth.paramss)(identity) {
407407
vparam =>
408408
if vparam.rhs.isEmpty then vparam
409-
else cpy.ValDef(vparam)(rhs = EmptyTree).withMods(vparam.mods | HasDefault)
409+
else cpy.ValDef(vparam)(/*rhs = EmptyTree*/).withMods(vparam.mods | HasDefault)
410410
}
411411

412412
def getterParamss(n: Int): List[ParamClause] =

compiler/src/dotty/tools/dotc/transform/PostTyper.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,9 @@ class PostTyper extends MacroTransform with InfoTransformer { thisPhase =>
229229
Checking.checkValidOperator(sym)
230230
sym.transformAnnotations(transformAnnot)
231231
sym.defTree = tree
232-
tree
232+
tree match
233+
case v: ValDef if v.mods.is(HasDefault) => cpy.ValDef(v)(rhs = EmptyTree).asInstanceOf[tree.type]
234+
case _ => tree
233235
}
234236

235237
private def registerIfUnrolledParam(sym: Symbol)(using Context): Unit =

0 commit comments

Comments
 (0)