diff --git a/compiler/src/dotty/tools/dotc/core/Flags.scala b/compiler/src/dotty/tools/dotc/core/Flags.scala index 817ae575581a..cb590e2384a0 100644 --- a/compiler/src/dotty/tools/dotc/core/Flags.scala +++ b/compiler/src/dotty/tools/dotc/core/Flags.scala @@ -531,7 +531,7 @@ object Flags { val RetainedModuleClassFlags: FlagSet = RetainedModuleValAndClassFlags | Enum /** Flags retained in export forwarders */ - val RetainedExportFlags = Given | Implicit | Inline | Transparent | HasDefaultParams | NoDefaultParams + val RetainedExportFlags = Given | Implicit | Inline | Transparent /** Flags that apply only to classes */ val ClassOnlyFlags = Sealed | Open | Abstract.toTypeFlags diff --git a/compiler/src/dotty/tools/dotc/typer/Namer.scala b/compiler/src/dotty/tools/dotc/typer/Namer.scala index df244717f458..127e03e3b47e 100644 --- a/compiler/src/dotty/tools/dotc/typer/Namer.scala +++ b/compiler/src/dotty/tools/dotc/typer/Namer.scala @@ -1128,7 +1128,9 @@ class Namer { typer: Typer => (StableRealizable, ExprType(path.tpe.select(sym))) else (EmptyFlags, mbr.info.ensureMethodic) - var mbrFlags = Exported | Method | Final | maybeStable | sym.flags & RetainedExportFlags + var flagMask = RetainedExportFlags + if sym.isTerm then flagMask |= HasDefaultParams | NoDefaultParams + var mbrFlags = Exported | Method | Final | maybeStable | sym.flags & flagMask if sym.is(ExtensionMethod) then mbrFlags |= ExtensionMethod val forwarderName = checkNoConflict(alias, isPrivate = false, span) newSymbol(cls, forwarderName, mbrFlags, mbrInfo, coord = span)