@@ -1154,21 +1154,17 @@ class Namer { typer: Typer =>
1154
1154
.flatMap(path.tpe.memberBasedOnFlags(_, excluded = Private | Given | ConstructorProxy ).alternatives)
1155
1155
.foreach(addForwarder(name, _, span)) // ignore if any are not added
1156
1156
1157
- val fromCaseClass = path.tpe.widen.classSymbols.exists(_.is(Case ))
1158
-
1159
- /** Is symbol from a base trait of a case class so that it will be synthesized
1160
- * in the case class itself. Such members are treated like synthetic members,
1161
- * i.e. they don't get export forwarders.
1162
- */
1163
- def isCaseClassSynthesized (mbr : Symbol ) =
1164
- fromCaseClass && defn.caseClassSynthesized.contains(mbr)
1165
-
1166
1157
def addWildcardForwarders (seen : List [TermName ], span : Span ): Unit =
1167
1158
val nonContextual = mutable.HashSet (seen : _* )
1159
+ val fromCaseClass = path.tpe.widen.classSymbols.exists(_.is(Case ))
1160
+ def isCaseClassSynthesized (mbr : Symbol ) =
1161
+ fromCaseClass && defn.caseClassSynthesized.contains(mbr)
1168
1162
for mbr <- path.tpe.membersBasedOnFlags(required = EmptyFlags , excluded = PrivateOrSynthetic ) do
1169
1163
if ! mbr.symbol.isSuperAccessor && ! isCaseClassSynthesized(mbr.symbol) then
1170
1164
// Scala 2 superaccessors have neither Synthetic nor Artfact set, so we
1171
1165
// need to filter them out here (by contrast, Scala 3 superaccessors are Artifacts)
1166
+ // Symbols from base traits of case classes that will get synthesized implementations
1167
+ // at PostTyper are also excluded.
1172
1168
val alias = mbr.name.toTermName
1173
1169
if mbr.symbol.is(Given ) then
1174
1170
if ! seen.contains(alias) && mbr.matchesImportBound(givenBound) then
0 commit comments