File tree 2 files changed +15
-3
lines changed
compiler/src/dotty/tools/dotc/transform
2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -697,10 +697,12 @@ object CheckUnused:
697
697
! sym.shouldNotReportParamOwner
698
698
699
699
private def shouldReportPrivateDef (using Context ): Boolean =
700
+ val sym = memDef.symbol
700
701
peekScopeType == ScopeType .Template
701
- && ! memDef.symbol.isConstructor
702
- && memDef.symbol.is(Private , butNot = SelfName | Synthetic | CaseAccessor )
703
- && ! ignoredSignature(memDef.symbol)
702
+ && ! sym.isConstructor
703
+ && (sym.is(Private , butNot = SelfName | Synthetic | CaseAccessor )
704
+ || sym.effectiveOwner.is(PackageClass ) && sym.denot.privateWithin == sym.effectiveOwner)
705
+ && ! ignoredSignature(sym)
704
706
705
707
private def isUnsetVarDef (using Context ): Boolean =
706
708
val sym = memDef.symbol
Original file line number Diff line number Diff line change @@ -285,3 +285,13 @@ class `absolve ONLY serial framework`:
285
285
private def readObjectNoData (): Unit = () // warn
286
286
@ throws(classOf [ObjectStreamException ])
287
287
private def readResolve (): Object = ??? // warn
288
+
289
+ @ throws(classOf [java.io.ObjectStreamException ])
290
+ private def readResolve (): Object = ??? // warn
291
+ private def print () = println() // warn
292
+ private val printed = false // warn
293
+
294
+ package locked:
295
+ private [locked] def locker (): Unit = () // warn as we cannot distinguish unqualified private at top level
296
+ package basement:
297
+ private [locked] def shackle (): Unit = () // no warn as it is not top level at boundary
You can’t perform that action at this time.
0 commit comments