File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -477,7 +477,10 @@ object SymDenotations {
477
477
478
478
/** The expanded name of this denotation. */
479
479
final def expandedName (using Context ): Name =
480
- if (name.is(ExpandedName ) || isConstructor) name
480
+ if name.is(ExpandedName ) || isConstructor
481
+ || name.is(DefaultGetterName ) && name.match { case DefaultGetterName (nme.CONSTRUCTOR , _) => true case _ => false }
482
+ then
483
+ name
481
484
else name.expandedName(initial.owner)
482
485
// need to use initial owner to disambiguate, as multiple private symbols with the same name
483
486
// might have been moved from different origins into the same class
Original file line number Diff line number Diff line change @@ -25,8 +25,8 @@ import ValueClasses.*
25
25
* This is necessary since private methods are not allowed to have the same name
26
26
* as inherited public ones.
27
27
*
28
- * Also, make non-private any private constructor that is annotated with `@publicInBinary`.
29
- * (See SIP-52)
28
+ * Also, make non-private any private constructor that is annotated with `@publicInBinary`.
29
+ * (See SIP-52)
30
30
*
31
31
* See discussion in https://github.com/scala/scala3/pull/784
32
32
* and https://github.com/scala/scala3/issues/783
Original file line number Diff line number Diff line change
1
+ //> using options -Ycheck:expandPrivate
2
+
3
+ class C private (x : Int , y : Int = 1 ):
4
+ def this () = this (1 )
You can’t perform that action at this time.
0 commit comments