Skip to content

Remove PreName add (almost) all other implicit conversions #4077

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala
Original file line number Diff line number Diff line change
Expand Up @@ -808,23 +808,25 @@ class DottyBackendInterface(outputDirectory: AbstractFile, val superCallsMap: Ma
else Nil

def annotations: List[Annotation] = toDenot(sym).annotations
def companionModuleMembers: List[Symbol] = {

def companionModuleMembers: List[Symbol] = {
// phase travel to exitingPickler: this makes sure that memberClassesOf only sees member classes,
// not local classes of the companion module (E in the exmaple) that were lifted by lambdalift.
if (linkedClass.isTopLevelModuleClass) /*exitingPickler*/ linkedClass.memberClasses
else Nil
}

def fieldSymbols: List[Symbol] = {
toDenot(sym).info.decls.filter(p => p.isTerm && !p.is(Flags.Method))
}

def methodSymbols: List[Symbol] =
for (f <- toDenot(sym).info.decls.toList if f.isMethod && f.isTerm && !f.isModule) yield f
def serialVUID: Option[Long] = None

def serialVUID: Option[Long] = None

def freshLocal(cunit: CompilationUnit, name: String, tpe: Type, pos: Position, flags: Flags): Symbol = {
ctx.newSymbol(sym, name.toTermName, FlagSet(flags), tpe, NoSymbol, pos)
}
def freshLocal(cunit: CompilationUnit, name: String, tpe: Type, pos: Position, flags: Flags): Symbol =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SymUtils is not used much, to this commit looks smallish. But we should use it more often because it gives us a way to add methods without overloading SymDenotation. In that case I think it is essential that it works for Symbol and SymDenotation in the same way. So my vote is to leave this as is.

ctx.newSymbol(sym, name.toTermName, FlagSet(flags), tpe, NoSymbol, pos.toCoord)

def getter(clz: Symbol): Symbol = decorateSymbol(sym).getter
def setter(clz: Symbol): Symbol = decorateSymbol(sym).setter
Expand Down
6 changes: 4 additions & 2 deletions compiler/src/dotty/tools/dotc/ast/Positioned.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ abstract class Positioned extends DotClass with Product {

setPos(initialPos)

/** The item's position.
*/
/** The item's position. */
def pos: Position = curPos

/** The item's coord. */
def coord: Coord = curPos.toCoord
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is wrong. "Coord" is an optimization for Symbols, so that they can take alternatively a Position or an Index. It's wrong to pollute other data types with this distinction - they should have no idea what a Coord is nor how to covert to it.


/** Destructively update `curPos` to given position. Also, set any missing
* positions in children.
*/
Expand Down
6 changes: 3 additions & 3 deletions compiler/src/dotty/tools/dotc/ast/tpd.scala
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
ta.assignType(untpd.ValDef(sym.name, TypeTree(sym.info), rhs), sym)

def SyntheticValDef(name: TermName, rhs: Tree)(implicit ctx: Context): ValDef =
ValDef(ctx.newSymbol(ctx.owner, name, Synthetic, rhs.tpe.widen, coord = rhs.pos), rhs)
ValDef(ctx.newSymbol(ctx.owner, name, Synthetic, rhs.tpe.widen, coord = rhs.coord), rhs)

def DefDef(sym: TermSymbol, tparams: List[TypeSymbol], vparamss: List[List[TermSymbol]],
resultType: Type, rhs: Tree)(implicit ctx: Context): DefDef =
Expand Down Expand Up @@ -270,7 +270,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
if (parents.head.classSymbol.is(Trait)) parents.head.parents.head :: parents
else parents
val cls = ctx.newNormalizedClassSymbol(owner, tpnme.ANON_CLASS, Synthetic, parents1,
coord = fns.map(_.pos).reduceLeft(_ union _))
coord = fns.map(_.pos).reduceLeft(_ union _).toCoord)
val constr = ctx.newConstructor(cls, Synthetic, Nil, Nil).entered
def forwarder(fn: TermSymbol, name: TermName) = {
val fwdMeth = fn.copy(cls, name, Synthetic | Method).entered.asTerm
Expand All @@ -284,7 +284,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
// { <label> def while$(): Unit = if (cond) { body; while$() } ; while$() }
def WhileDo(owner: Symbol, cond: Tree, body: List[Tree])(implicit ctx: Context): Tree = {
val sym = ctx.newSymbol(owner, nme.WHILE_PREFIX, Flags.Label | Flags.Synthetic,
MethodType(Nil, defn.UnitType), coord = cond.pos)
MethodType(Nil, defn.UnitType), coord = cond.coord)

val call = Apply(ref(sym), Nil)
val rhs = If(cond, Block(body, call), unitLiteral)
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/core/Symbols.scala
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ trait Symbols { this: Context =>
/** Define a new symbol associated with a Bind or pattern wildcard and
* make it gadt narrowable.
*/
def newPatternBoundSymbol(name: Name, info: Type, pos: Position) = {
val sym = newSymbol(owner, name, Case, info, coord = pos)
def newPatternBoundSymbol(name: Name, info: Type, coord: Coord) = {
val sym = newSymbol(owner, name, Case, info, coord = coord)
if (name.isTypeName) gadt.setBounds(sym, info.bounds)
sym
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ object PickledQuotes {
*/
private def encapsulateQuote(tree: Tree)(implicit ctx: Context): Tree = {
val name = (if (tree.isTerm) "$quote" else "$typeQuote").toTermName
val sym = ctx.newSymbol(ctx.owner, name, Synthetic, defn.AnyType, coord = tree.pos)
val sym = ctx.newSymbol(ctx.owner, name, Synthetic, defn.AnyType, coord = tree.coord)
val encoded =
if (tree.isTerm) tree
else Literal(Constant(null)).select(nme.asInstanceOf_).appliedToTypeTrees(tree :: Nil)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1164,7 +1164,7 @@ class TreeUnpickler(reader: TastyReader,
def coordAt(addr: Addr)(implicit ctx: Context): Coord = {
val pos = posAt(addr)
if (pos.exists)
positionCoord(pos)
pos.toCoord
else
indexCoord(addr.index)
}
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/quoted/ExprCompiler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ class ExprCompiler(directory: AbstractFile) extends Compiler {
val assocFile = new PlainFile(Path("<quote>"))

val cls = ctx.newCompleteClassSymbol(defn.RootClass, outputClassName, EmptyFlags,
defn.ObjectType :: Nil, newScope, coord = pos, assocFile = assocFile).entered.asClass
defn.ObjectType :: Nil, newScope, coord = pos.toCoord, assocFile = assocFile).entered.asClass
cls.enter(ctx.newDefaultConstructor(cls), EmptyScope)
val meth = ctx.newSymbol(cls, nme.apply, Method, ExprType(defn.AnyType), coord = pos).entered
val meth = ctx.newSymbol(cls, nme.apply, Method, ExprType(defn.AnyType), coord = pos.toCoord).entered

val quoted = PickledQuotes.quotedExprToTree(expr)(ctx.withOwner(meth))

Expand Down
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/transform/Bridges.scala
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ class Bridges(root: ClassSymbol)(implicit ctx: Context) {
owner = root,
flags = (member.flags | Method | Bridge | Artifact) &~
(Accessor | ParamAccessor | CaseAccessor | Deferred | Lazy | Module),
coord = bridgePosFor(member))
.enteredAfter(ctx.erasurePhase.asInstanceOf[DenotTransformer]).asTerm
coord = bridgePosFor(member).toCoord)
.enteredAfter(ctx.base.erasurePhase.asInstanceOf[DenotTransformer]).asTerm

ctx.debuglog(
i"""generating bridge from ${other.showLocated}: ${other.info}
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/transform/LazyVals.scala
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ class LazyVals extends MiniPhase with IdentityDenotTransformer {

val holderImpl = ctx.requiredClass("dotty.runtime." + holderType)

val holderSymbol = ctx.newSymbol(x.symbol.owner, holderName, containerFlags, holderImpl.typeRef, coord = x.pos)
val initSymbol = ctx.newSymbol(x.symbol.owner, initName, initFlags, MethodType(Nil, tpe), coord = x.pos)
val holderSymbol = ctx.newSymbol(x.symbol.owner, holderName, containerFlags, holderImpl.typeRef, coord = x.coord)
val initSymbol = ctx.newSymbol(x.symbol.owner, initName, initFlags, MethodType(Nil, tpe), coord = x.coord)
val result = ref(holderSymbol).select(lazyNme.value).withPos(x.pos)
val flag = ref(holderSymbol).select(lazyNme.initialized)
val initer = valueInitter.changeOwnerAfter(x.symbol, initSymbol, this)
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/transform/LiftTry.scala
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class LiftTry extends MiniPhase with IdentityDenotTransformer { thisPhase =>
ctx.debuglog(i"lifting tree at ${tree.pos}, current owner = ${ctx.owner}")
val fn = ctx.newSymbol(
ctx.owner, LiftedTreeName.fresh(), Synthetic | Method,
MethodType(Nil, tree.tpe.widenIfUnstable), coord = tree.pos)
MethodType(Nil, tree.tpe.widenIfUnstable), coord = tree.coord)
tree.changeOwnerAfter(ctx.owner, fn, thisPhase)
Block(DefDef(fn, tree) :: Nil, ref(fn).appliedToNone)
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/transform/Memoize.scala
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ import Decorators._
name = sym.name.asTermName.fieldName,
flags = Private | (if (sym is Stable) EmptyFlags else Mutable),
info = fieldType,
coord = tree.pos
coord = tree.coord
).withAnnotationsCarrying(sym, defn.FieldMetaAnnot)
.enteredAfter(thisPhase)
}
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/transform/NonLocalReturns.scala
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class NonLocalReturns extends MiniPhase {
private def nonLocalReturnKey(meth: Symbol)(implicit ctx: Context) =
nonLocalReturnKeys.getOrElseUpdate(meth,
ctx.newSymbol(
meth, NonLocalReturnKeyName.fresh(), Synthetic, defn.ObjectType, coord = meth.pos))
meth, NonLocalReturnKeyName.fresh(), Synthetic, defn.ObjectType, coord = meth.coord))

/** Generate a non-local return throw with given return expression from given method.
* I.e. for the method's non-local return key, generate:
Expand Down Expand Up @@ -70,7 +70,7 @@ class NonLocalReturns extends MiniPhase {
private def nonLocalReturnTry(body: Tree, key: TermSymbol, meth: Symbol)(implicit ctx: Context) = {
val keyDef = ValDef(key, New(defn.ObjectType, Nil))
val nonLocalReturnControl = defn.NonLocalReturnControlType
val ex = ctx.newSymbol(meth, nme.ex, EmptyFlags, nonLocalReturnControl, coord = body.pos)
val ex = ctx.newSymbol(meth, nme.ex, EmptyFlags, nonLocalReturnControl, coord = body.coord)
val pat = BindTyped(ex, nonLocalReturnControl)
val rhs = If(
ref(ex).select(nme.key).appliedToNone.select(nme.eq).appliedTo(ref(key)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ object PatternMatcher {

private def newVar(rhs: Tree, flags: FlagSet): TermSymbol =
ctx.newSymbol(ctx.owner, PatMatStdBinderName.fresh(), Synthetic | Case | flags,
sanitize(rhs.tpe), coord = rhs.pos)
sanitize(rhs.tpe), coord = rhs.coord)
// TODO: Drop Case once we use everywhere else `isPatmatGenerated`.

/** The plan `let x = rhs in body(x)` where `x` is a fresh variable */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,8 @@ class PatternMatcherOld extends MiniPhase with DenotTransformer {
trait CodegenCore {

// assert(owner ne null); assert(owner ne NoSymbol)
def freshSym(pos: Position, tp: Type = NoType, unique: UniqueNameKind = PatMatStdBinderName, owner: Symbol = ctx.owner) = {
ctx.newSymbol(owner, unique.fresh(), Flags.Synthetic | Flags.Case, tp, coord = pos)
}
def freshSym(pos: Position, tp: Type = NoType, unique: UniqueNameKind = PatMatStdBinderName, owner: Symbol = ctx.owner) =
ctx.newSymbol(owner, unique.fresh(), Flags.Synthetic | Flags.Case, tp, coord = pos.toCoord)

def newSynthCaseLabel(unique: UniqueNameKind, tpe: Type, owner: Symbol = ctx.owner) =
ctx.newSymbol(owner, unique.fresh(), Flags.Label | Flags.Synthetic | Flags.Method, tpe).asTerm
Expand Down
20 changes: 8 additions & 12 deletions compiler/src/dotty/tools/dotc/transform/SuperAccessors.scala
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,18 @@ class SuperAccessors(thisPhase: DenotTransformer) {
if (clazz is Trait) superName = superName.expandedName(clazz)
val superInfo = sel.tpe.widenSingleton.ensureMethodic

val accPos = sel.pos.focus
val superAcc = clazz.info.decl(superName)
.suchThat(_.signature == superInfo.signature).symbol
.orElse {
ctx.debuglog(s"add super acc ${sym.showLocated} to $clazz")
val maybeDeferred = if (clazz is Trait) Deferred else EmptyFlags
val acc = ctx.newSymbol(
clazz, superName, Artifact | Method | maybeDeferred,
superInfo, coord = accPos).enteredAfter(thisPhase)
superInfo, coord = sel.coord).enteredAfter(thisPhase)
// Diagnostic for SI-7091
if (!accDefs.contains(clazz))
ctx.error(s"Internal error: unable to store accessor definition in ${clazz}. clazz.hasPackageFlag=${clazz is Package}. Accessor required for ${sel} (${sel.show})", sel.pos)
else accDefs(clazz) += DefDef(acc, EmptyTree).withPos(accPos)
else accDefs(clazz) += DefDef(acc, EmptyTree).withPos(sel.pos.focus)
acc
}

Expand Down Expand Up @@ -182,14 +181,13 @@ class SuperAccessors(thisPhase: DenotTransformer) {
}
accTypeOf(sym.info)
}
val accPos = sel.pos.focus
val protectedAccessor = clazz.info.decl(accName).suchThat(_.signature == accType.signature).symbol orElse {
val newAcc = ctx.newSymbol(
clazz, accName, Artifact | Method, accType, coord = accPos).enteredAfter(thisPhase)
clazz, accName, Artifact | Method, accType, coord = sel.coord).enteredAfter(thisPhase)
val code = polyDefDef(newAcc, trefs => vrefss => {
val (receiver :: _) :: tail = vrefss
val base = receiver.select(sym).appliedToTypes(trefs)
(base /: tail)(Apply(_, _)).withPos(accPos)
(base /: tail)(Apply(_, _)).withPos(sel.pos.focus)
})
ctx.debuglog("created protected accessor: " + code)
accDefs(clazz) += code
Expand Down Expand Up @@ -235,14 +233,13 @@ class SuperAccessors(thisPhase: DenotTransformer) {
MethodType(receiverType :: Nil)(mt => tpe.substThis(sym.owner.asClass, mt.newParamRef(0)))
}
val accType = accTypeOf(sym.info)
val accPos = tree.pos.focus
val protectedAccessor = clazz.info.decl(accName).suchThat(_.signature == accType.signature).symbol orElse {
val newAcc = ctx.newSymbol(
clazz, accName, Artifact, accType, coord = accPos).enteredAfter(thisPhase)
clazz, accName, Artifact, accType, coord = tree.coord).enteredAfter(thisPhase)
val code = polyDefDef(newAcc, trefs => vrefss => {
val (receiver :: _) :: tail = vrefss
val base = receiver.select(sym).appliedToTypes(trefs)
(base /: vrefss)(Apply(_, _)).withPos(accPos)
(base /: vrefss)(Apply(_, _)).withPos(tree.pos.focus)
})
ctx.debuglog("created protected accessor: " + code)
accDefs(clazz) += code
Expand All @@ -268,13 +265,12 @@ class SuperAccessors(thisPhase: DenotTransformer) {

val accName = ProtectedSetterName(field.name)
val accType = MethodType(clazz.classInfo.selfType :: field.info :: Nil, defn.UnitType)
val accPos = tree.pos.focus
val protectedAccessor = clazz.info.decl(accName).symbol orElse {
val newAcc = ctx.newSymbol(
clazz, accName, Artifact | Method, accType, coord = accPos).enteredAfter(thisPhase)
clazz, accName, Artifact | Method, accType, coord = tree.coord).enteredAfter(thisPhase)
val code = DefDef(newAcc, vrefss => {
val (receiver :: value :: Nil) :: Nil = vrefss
Assign(receiver.select(field), value).withPos(accPos)
Assign(receiver.select(field), value).withPos(tree.pos.focus)
})
ctx.debuglog("created protected setter: " + code)
accDefs(clazz) += code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class SyntheticMethods(thisPhase: DenotTransformer) {
* If `C` is a value class the initial `eq` test is omitted.
*/
def equalsBody(that: Tree)(implicit ctx: Context): Tree = {
val thatAsClazz = ctx.newSymbol(ctx.owner, nme.x_0, Synthetic, clazzType, coord = ctx.owner.pos) // x$0
val thatAsClazz = ctx.newSymbol(ctx.owner, nme.x_0, Synthetic, clazzType, coord = ctx.owner.coord) // x$0
def wildcardAscription(tp: Type) = Typed(Underscore(tp), TypeTree(tp))
val pattern = Bind(thatAsClazz, wildcardAscription(clazzType)) // x$0 @ (_: C)
val comparisons = accessors map { accessor =>
Expand Down Expand Up @@ -215,7 +215,7 @@ class SyntheticMethods(thisPhase: DenotTransformer) {
def caseHashCodeBody(implicit ctx: Context): Tree = {
val seed = clazz.fullName.toString.hashCode
if (accessors.nonEmpty) {
val acc = ctx.newSymbol(ctx.owner, "acc".toTermName, Mutable | Synthetic, defn.IntType, coord = ctx.owner.pos)
val acc = ctx.newSymbol(ctx.owner, "acc".toTermName, Mutable | Synthetic, defn.IntType, coord = ctx.owner.coord)
val accDef = ValDef(acc, Literal(Constant(seed)))
val mixes = for (accessor <- accessors) yield
Assign(ref(acc), ref(defn.staticsMethod("mix".toTermName)).appliedTo(ref(acc), hashImpl(accessor)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class TryCatchPatterns extends MiniPhase {
else {
val exName = ExceptionBinderName.fresh()
val fallbackSelector =
ctx.newSymbol(ctx.owner, exName, Flags.Synthetic | Flags.Case, defn.ThrowableType, coord = pos)
ctx.newSymbol(ctx.owner, exName, Flags.Synthetic | Flags.Case, defn.ThrowableType, coord = pos.toCoord)
val sel = Ident(fallbackSelector.termRef).withPos(pos)
val rethrow = CaseDef(EmptyTree, EmptyTree, Throw(ref(fallbackSelector)))
Some(CaseDef(
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/typer/Applications.scala
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
fullyDefinedType(unapplyArgType, "pattern selector", tree.pos)
selType
} else if (isSubTypeOfParent(unapplyArgType, selType)(ctx.addMode(Mode.GADTflexible))) {
val patternBound = maximizeType(unapplyArgType, tree.pos, fromScala2x)
val patternBound = maximizeType(unapplyArgType, tree.coord, fromScala2x)
if (patternBound.nonEmpty) unapplyFn = addBinders(unapplyFn, patternBound)
unapp.println(i"case 2 $unapplyArgType ${ctx.typerState.constraint}")
unapplyArgType
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/typer/EtaExpansion.scala
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ abstract class Lifter {
val name = UniqueName.fresh(prefix)
var liftedType = fullyDefinedType(expr.tpe.widen, "lifted expression", expr.pos)
if (liftedFlags.is(Method)) liftedType = ExprType(liftedType)
val lifted = ctx.newSymbol(ctx.owner, name, liftedFlags, liftedType, coord = positionCoord(expr.pos))
val lifted = ctx.newSymbol(ctx.owner, name, liftedFlags, liftedType, coord = expr.coord)
defs += liftedDef(lifted, expr).withPos(expr.pos.focus)
ref(lifted.termRef).withPos(expr.pos)
}
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/typer/Inferencing.scala
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ object Inferencing {
* @return The list of type symbols that were created
* to instantiate undetermined type variables that occur non-variantly
*/
def maximizeType(tp: Type, pos: Position, fromScala2x: Boolean)(implicit ctx: Context): List[Symbol] = Stats.track("maximizeType") {
def maximizeType(tp: Type, coord: Coord, fromScala2x: Boolean)(implicit ctx: Context): List[Symbol] = Stats.track("maximizeType") {
val vs = variances(tp)
val patternBound = new mutable.ListBuffer[Symbol]
vs foreachBinding { (tvar, v) =>
Expand All @@ -242,7 +242,7 @@ object Inferencing {
if (bounds.hi <:< bounds.lo || bounds.hi.classSymbol.is(Final) || fromScala2x)
tvar.instantiate(fromBelow = false)
else {
val wildCard = ctx.newPatternBoundSymbol(UniqueName.fresh(tvar.origin.paramName), bounds, pos)
val wildCard = ctx.newPatternBoundSymbol(UniqueName.fresh(tvar.origin.paramName), bounds, coord)
tvar.instantiateWith(wildCard.typeRef)
patternBound += wildCard
}
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/typer/Inliner.scala
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ object Inliner {
name = if (tree.isTerm) accessorName.toTermName else accessorName.toTypeName,
flags = if (tree.isTerm) Synthetic | Method else Synthetic,
info = accessorInfo,
coord = tree.pos).entered
coord = tree.coord).entered

/** Add an accessor to a non-public method and replace the original access with a
* call to the accessor.
Expand Down Expand Up @@ -337,7 +337,7 @@ class Inliner(call: tpd.Tree, rhs: tpd.Tree)(implicit ctx: Context) {
computeParamBindings(meth.info, targs, argss)

private def newSym(name: Name, flags: FlagSet, info: Type): Symbol =
ctx.newSymbol(ctx.owner, name, flags, info, coord = call.pos)
ctx.newSymbol(ctx.owner, name, flags, info, coord = call.coord)

/** Populate `paramBinding` and `bindingsBuf` by matching parameters with
* corresponding arguments. `bindingbuf` will be further extended later by
Expand Down
Loading