File tree Expand file tree Collapse file tree 4 files changed +18
-1
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 4 files changed +18
-1
lines changed Original file line number Diff line number Diff 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
534+ val RetainedExportFlags = Given | Implicit | Inline | Transparent | HasDefaultParams | NoDefaultParams
535535
536536 /** Flags that apply only to classes */
537537 val ClassOnlyFlags = Sealed | Open | Abstract .toTypeFlags
Original file line number Diff line number Diff line change @@ -1116,6 +1116,7 @@ class Namer { typer: Typer =>
11161116 (StableRealizable , ExprType (path.tpe.select(sym)))
11171117 else
11181118 (EmptyFlags , mbr.info.ensureMethodic)
1119+ sym.hasDefaultParams // ensure HasDefaultParams and NoDefaultParams flags are set
11191120 var mbrFlags = Exported | Method | Final | maybeStable | sym.flags & RetainedExportFlags
11201121 if sym.is(ExtensionMethod ) then mbrFlags |= ExtensionMethod
11211122 val forwarderName = checkNoConflict(alias, isPrivate = false , span)
Original file line number Diff line number Diff line change 1+ Hello you
2+ Hello John
3+ Hello you
Original file line number Diff line number Diff line change 1+ class A :
2+ def greeting (name : String = " you" ) = s " Hello $name"
3+
4+ class B :
5+ val a = A ()
6+ export a .*
7+
8+ @ main def Test =
9+ val b = B ()
10+
11+ println(b.a.greeting()) // works
12+ println(b.greeting(" John" )) // works
13+ println(b.greeting()) // nope !
You can’t perform that action at this time.
0 commit comments