diff --git a/compiler/src/dotty/tools/dotc/typer/ReTyper.scala b/compiler/src/dotty/tools/dotc/typer/ReTyper.scala index 8ff0dfc8c61b..42c71c1a7b72 100644 --- a/compiler/src/dotty/tools/dotc/typer/ReTyper.scala +++ b/compiler/src/dotty/tools/dotc/typer/ReTyper.scala @@ -115,7 +115,9 @@ class ReTyper extends Typer with ReChecking { } override def typedUnadapted(tree: untpd.Tree, pt: Type, locked: TypeVars)(using Context): Tree = - try super.typedUnadapted(tree, pt, locked) + try super.typedUnadapted(tree, pt, locked) match + case member: MemberDef => member.setDefTree + case tree => tree catch { case NonFatal(ex) => if ctx.phase != Phases.typerPhase && ctx.phase != Phases.inliningPhase then