Skip to content

Commit

Permalink
Remove unnecessary newScope in newNormalizedClassSymbol
Browse files Browse the repository at this point in the history
This was added in scala#14026
  • Loading branch information
nicolasstucki authored and olsdavis committed Apr 4, 2022
1 parent 19fb504 commit 79f6ed9
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/ast/tpd.scala
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
}
else parents
val cls = newNormalizedClassSymbol(owner, tpnme.ANON_CLASS, Synthetic | Final, parents1,
newScope, coord = fns.map(_.span).reduceLeft(_ union _))
coord = fns.map(_.span).reduceLeft(_ union _))
val constr = newConstructor(cls, Synthetic, Nil, Nil).entered
def forwarder(fn: TermSymbol, name: TermName) = {
val fwdMeth = fn.copy(cls, name, Synthetic | Method | Final).entered.asTerm
Expand Down
1 change: 0 additions & 1 deletion compiler/src/dotty/tools/dotc/core/Symbols.scala
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,6 @@ object Symbols {
name: TypeName,
flags: FlagSet,
parentTypes: List[Type],
decls: Scope,
selfInfo: Type = NoType,
privateWithin: Symbol = NoSymbol,
coord: Coord = NoCoord,
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/transform/ExpandSAMs.scala
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class ExpandSAMs extends MiniPhase:
val parents = List(
defn.AbstractPartialFunctionClass.typeRef.appliedTo(anonTpe.firstParamTypes.head, anonTpe.resultType),
defn.SerializableType)
val pfSym = newNormalizedClassSymbol(anonSym.owner, tpnme.ANON_CLASS, Synthetic | Final, parents, newScope, coord = tree.span)
val pfSym = newNormalizedClassSymbol(anonSym.owner, tpnme.ANON_CLASS, Synthetic | Final, parents, coord = tree.span)

def overrideSym(sym: Symbol) = sym.copy(
owner = pfSym,
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/typer/Implicits.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1799,7 +1799,7 @@ final class SearchRoot extends SearchHistory:
// }

val parents = List(defn.ObjectType, defn.SerializableType)
val classSym = newNormalizedClassSymbol(ctx.owner, LazyImplicitName.fresh().toTypeName, Synthetic | Final, parents, newScope, coord = span)
val classSym = newNormalizedClassSymbol(ctx.owner, LazyImplicitName.fresh().toTypeName, Synthetic | Final, parents, coord = span)
val vsyms = pruned.map(_._1.symbol)
val nsyms = vsyms.map(vsym => newSymbol(classSym, vsym.name, EmptyFlags, vsym.info, coord = span).entered)
val vsymMap = (vsyms zip nsyms).toMap
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/typer/Inliner.scala
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ object Inliner {

val UnApply(fun, implicits, patterns) = unapp
val sym = unapp.symbol
val cls = newNormalizedClassSymbol(ctx.owner, tpnme.ANON_CLASS, Synthetic | Final, List(defn.ObjectType), newScope, coord = sym.coord)
val cls = newNormalizedClassSymbol(ctx.owner, tpnme.ANON_CLASS, Synthetic | Final, List(defn.ObjectType), coord = sym.coord)
val constr = newConstructor(cls, Synthetic, Nil, Nil, coord = sym.coord).entered

val targs = fun match
Expand Down

0 comments on commit 79f6ed9

Please sign in to comment.