Skip to content

Commit 95457b2

Browse files
committed
Fix flags of export forwarders
1 parent d4be1f8 commit 95457b2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

compiler/src/dotty/tools/dotc/core/Flags.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ object Flags {
531531
val RetainedModuleClassFlags: FlagSet = RetainedModuleValAndClassFlags | Enum
532532

533533
/** Flags retained in export forwarders */
534-
val RetainedExportFlags = Given | Implicit | Inline | Transparent | HasDefaultParams | NoDefaultParams
534+
val RetainedExportFlags = Given | Implicit | Inline | Transparent
535535

536536
/** Flags that apply only to classes */
537537
val ClassOnlyFlags = Sealed | Open | Abstract.toTypeFlags

compiler/src/dotty/tools/dotc/typer/Namer.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1128,7 +1128,9 @@ class Namer { typer: Typer =>
11281128
(StableRealizable, ExprType(path.tpe.select(sym)))
11291129
else
11301130
(EmptyFlags, mbr.info.ensureMethodic)
1131-
var mbrFlags = Exported | Method | Final | maybeStable | sym.flags & RetainedExportFlags
1131+
var flagMask = RetainedExportFlags
1132+
if sym.isTerm then flagMask |= HasDefaultParams | NoDefaultParams
1133+
var mbrFlags = Exported | Method | Final | maybeStable | sym.flags & flagMask
11321134
if sym.is(ExtensionMethod) then mbrFlags |= ExtensionMethod
11331135
val forwarderName = checkNoConflict(alias, isPrivate = false, span)
11341136
newSymbol(cls, forwarderName, mbrFlags, mbrInfo, coord = span)

0 commit comments

Comments
 (0)