File tree 4 files changed +18
-1
lines changed
compiler/src/dotty/tools/dotc 4 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -531,7 +531,7 @@ object Flags {
531
531
val RetainedModuleClassFlags : FlagSet = RetainedModuleValAndClassFlags | Enum
532
532
533
533
/** Flags retained in export forwarders */
534
- val RetainedExportFlags = Given | Implicit | Inline | Transparent
534
+ val RetainedExportFlags = Given | Implicit | Inline | Transparent | HasDefaultParams | NoDefaultParams
535
535
536
536
/** Flags that apply only to classes */
537
537
val ClassOnlyFlags = Sealed | Open | Abstract .toTypeFlags
Original file line number Diff line number Diff line change @@ -1116,6 +1116,7 @@ class Namer { typer: Typer =>
1116
1116
(StableRealizable , ExprType (path.tpe.select(sym)))
1117
1117
else
1118
1118
(EmptyFlags , mbr.info.ensureMethodic)
1119
+ sym.hasDefaultParams // ensure HasDefaultParams and NoDefaultParams flags are set
1119
1120
var mbrFlags = Exported | Method | Final | maybeStable | sym.flags & RetainedExportFlags
1120
1121
if sym.is(ExtensionMethod ) then mbrFlags |= ExtensionMethod
1121
1122
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