@@ -30,7 +30,6 @@ import config.Feature.{sourceVersion, modularity}
3030import config .SourceVersion .*
3131
3232import scala .compiletime .uninitialized
33- import dotty .tools .dotc .transform .init .Util .tree
3433
3534/** This class creates symbols from definitions and imports and gives them
3635 * lazy types.
@@ -1699,7 +1698,6 @@ class Namer { typer: Typer =>
16991698 end addUsingTraits
17001699
17011700 completeConstructor(denot)
1702- val constrSym = symbolOfTree(constr)
17031701 denot.info = tempInfo.nn
17041702
17051703 val parentTypes = defn.adjustForTuple(cls, cls.typeParams,
@@ -1995,7 +1993,11 @@ class Namer { typer: Typer =>
19951993 */
19961994 def needsTracked (sym : Symbol , param : ValDef )(using Context ) =
19971995 ! sym.is(Tracked )
1998- && sym.maybeOwner.isConstructor
1996+ && sym.isTerm
1997+ && sym.maybeOwner.isPrimaryConstructor
1998+ // && !sym.flags.is(Synthetic)
1999+ // && !sym.maybeOwner.flags.is(Synthetic)
2000+ && ! sym.maybeOwner.maybeOwner.flags.is(Synthetic )
19992001 && (
20002002 isContextBoundWitnessWithAbstractMembers(sym, param)
20012003 || isReferencedInPublicSignatures(sym)
@@ -2018,7 +2020,7 @@ class Namer { typer: Typer =>
20182020 def checkOwnerMemberSignatures (owner : Symbol ): Boolean =
20192021 owner.infoOrCompleter match
20202022 case info : ClassInfo =>
2021- info.decls.filter(_.isTerm)
2023+ info.decls.filter(_.isTerm).filter(_.isPublic)
20222024 .filter(_ != sym.maybeOwner)
20232025 .exists(d => tpeContainsSymbolRef(d.info, accessorSyms))
20242026 case _ => false
@@ -2039,8 +2041,9 @@ class Namer { typer: Typer =>
20392041 case _ => false
20402042
20412043 private def tpeContainsSymbolRef (tpe0 : Type , syms : List [Symbol ])(using Context ): Boolean =
2042- val tpe = tpe0.dropAlias.widenExpr.dealias
2044+ val tpe = tpe0.dropAlias.safeDealias
20432045 tpe match
2046+ case ExprType (resType) => tpeContainsSymbolRef(resType, syms)
20442047 case m : MethodOrPoly =>
20452048 m.paramInfos.exists(tpeContainsSymbolRef(_, syms))
20462049 || tpeContainsSymbolRef(m.resultType, syms)
0 commit comments