Skip to content

Commit e29f4fd

Browse files
committed
Drop ResetPrivate flag
1 parent f6b5e0e commit e29f4fd

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

compiler/src/dotty/tools/dotc/cc/Setup.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ class Setup extends PreRecheck, SymTransformer, SetupAPI:
7070
if symd.isAllOf(PrivateParamAccessor)
7171
&& symd.owner.is(CaptureChecked)
7272
&& !symd.hasAnnotation(defn.ConstructorOnlyAnnot)
73-
//&& containsCovarRetains(symd.symbol.originDenotation.info)
74-
then symd.flags &~ Private | Recheck.ResetPrivate
73+
&& containsCovarRetains(symd.symbol.originDenotation.info)
74+
then symd.flags &~ Private
7575
else symd.flags
7676

7777
def isPreCC(sym: Symbol)(using Context): Boolean =

compiler/src/dotty/tools/dotc/transform/OverridingPairs.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ object OverridingPairs:
3434
*/
3535
protected def exclude(sym: Symbol): Boolean =
3636
!sym.memberCanMatchInheritedSymbols
37-
|| isCaptureChecking && sym.is(Recheck.ResetPrivate)
37+
|| isCaptureChecking && atPhase(ctx.phase.prev)(sym.is(Private))
38+
// for capture checking we drop the private flag of certain parameter accessors
39+
// but these still need no overriding checks
3840

3941
/** The parents of base that are checked when deciding whether an overriding
4042
* pair has already been treated in a parent class.

compiler/src/dotty/tools/dotc/transform/Recheck.scala

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,6 @@ import annotation.tailrec
2727
object Recheck:
2828
import tpd.*
2929

30-
/** A flag used to indicate that a ParamAccessor has been temporarily made not-private
31-
* Only used at the start of the Recheck phase, reset at its end.
32-
* The flag repurposes the Scala2ModuleVar flag. No confusion is possible since
33-
* Scala2ModuleVar cannot be also ParamAccessors.
34-
*/
35-
val ResetPrivate = Scala2ModuleVar
36-
3730
/** Attachment key for rechecked types of TypeTrees */
3831
val RecheckedType = Property.Key[Type]
3932

0 commit comments

Comments
 (0)