File tree 1 file changed +2
-15
lines changed
compiler/src/dotty/tools/dotc/ast
1 file changed +2
-15
lines changed Original file line number Diff line number Diff line change @@ -693,24 +693,11 @@ object desugar {
693
693
// For all other classes, the parent is AnyRef.
694
694
val companions =
695
695
if (isCaseClass) {
696
-
697
- // true if access to the apply method has to be restricted
698
- // i.e. if the case class constructor is either private or qualified private
699
- def restrictedAccess = {
700
- val mods = constr1.mods
701
- mods.is(Private ) || (! mods.is(Protected ) && mods.hasPrivateWithin)
702
- }
703
-
704
696
val applyMeths =
705
697
if (mods.is(Abstract )) Nil
706
698
else {
707
- val copiedFlagsMask = copiedAccessFlags & Private
708
- val appMods = {
709
- val protectedToPrivate = if constr1.mods.is(Protected ) then Protected | Private else EmptyFlags
710
- val mods = Modifiers ((Synthetic | constr1.mods.flags ^ protectedToPrivate) & copiedFlagsMask)
711
- if (restrictedAccess) mods.withPrivateWithin(constr1.mods.privateWithin)
712
- else mods
713
- }
699
+ val appMods =
700
+ Modifiers (Synthetic | constr1.mods.flags & copiedAccessFlags).withPrivateWithin(constr1.mods.privateWithin)
714
701
val appParamss =
715
702
derivedVparamss.nestedZipWithConserve(constrVparamss)((ap, cp) =>
716
703
ap.withMods(ap.mods | (cp.mods.flags & HasDefault )))
You can’t perform that action at this time.
0 commit comments