File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
compiler/src/dotty/tools/dotc/ast Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -706,7 +706,8 @@ object desugar {
706
706
else {
707
707
val copiedFlagsMask = copiedAccessFlags & Private
708
708
val appMods = {
709
- val mods = Modifiers (Synthetic | constr1.mods.flags & copiedFlagsMask)
709
+ val protectedToPrivate = if constr1.mods.is(Protected ) then Protected | Private else EmptyFlags
710
+ val mods = Modifiers ((Synthetic | constr1.mods.flags ^ protectedToPrivate) & copiedFlagsMask)
710
711
if (restrictedAccess) mods.withPrivateWithin(constr1.mods.privateWithin)
711
712
else mods
712
713
}
Original file line number Diff line number Diff line change
1
+ sealed case class Foo protected (i : Int , j : Int )
2
+
3
+ final class Bar (n : Int ) extends Foo (n, n)
4
+
5
+ class Other :
6
+ def foo = Foo (1 , 2 ) // error
7
+ def foo2 = Foo .apply(1 , 2 ) // error
You can’t perform that action at this time.
0 commit comments