Skip to content

Commit 7ffdc2f

Browse files
oderskynicolasstucki
authored andcommitted
Rename Symbol#pos -> span, Comment#pos -> span
1 parent c3894ea commit 7ffdc2f

File tree

19 files changed

+60
-61
lines changed

19 files changed

+60
-61
lines changed

compiler/src/dotty/tools/backend/sjs/JSCodeGen.scala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class JSCodeGen()(implicit ctx: Context) {
129129
/* Finally, we emit true code for the remaining class defs. */
130130
for (td <- allTypeDefs) {
131131
val sym = td.symbol
132-
implicit val pos: Position = sym.pos
132+
implicit val pos: Position = sym.span
133133

134134
/* Do not actually emit code for primitive types nor scala.Array. */
135135
val isPrimitive =
@@ -197,7 +197,7 @@ class JSCodeGen()(implicit ctx: Context) {
197197
*/
198198
private def genScalaClass(td: TypeDef): js.ClassDef = {
199199
val sym = td.symbol.asClass
200-
implicit val pos: Position = sym.pos
200+
implicit val pos: Position = sym.span
201201

202202
assert(!sym.is(Trait),
203203
"genScalaClass() must be called only for normal classes: "+sym)
@@ -321,7 +321,7 @@ class JSCodeGen()(implicit ctx: Context) {
321321
*/
322322
private def genRawJSClassData(td: TypeDef): js.ClassDef = {
323323
val sym = td.symbol.asClass
324-
implicit val pos: Position = sym.pos
324+
implicit val pos: Position = sym.span
325325

326326
val classIdent = encodeClassFullNameIdent(sym)
327327
val kind = {
@@ -357,7 +357,7 @@ class JSCodeGen()(implicit ctx: Context) {
357357
*/
358358
private def genInterface(td: TypeDef): js.ClassDef = {
359359
val sym = td.symbol.asClass
360-
implicit val pos: Position = sym.pos
360+
implicit val pos: Position = sym.span
361361

362362
val classIdent = encodeClassFullNameIdent(sym)
363363

@@ -413,7 +413,7 @@ class JSCodeGen()(implicit ctx: Context) {
413413

414414
// Non-method term members are fields
415415
classSym.info.decls.filter(f => !f.is(Method) && f.isTerm).map({ f =>
416-
implicit val pos = f.pos
416+
implicit val pos = f.span
417417

418418
val name =
419419
/*if (isExposed(f)) js.StringLiteral(jsNameOf(f))
@@ -506,7 +506,7 @@ class JSCodeGen()(implicit ctx: Context) {
506506
val methodName: js.PropertyName = encodeMethodSym(sym)
507507

508508
def jsParams = for (param <- params) yield {
509-
implicit val pos = param.pos
509+
implicit val pos = param.span
510510
js.ParamDef(encodeLocalSym(param), toIRType(param.info),
511511
mutable = false, rest = false)
512512
}
@@ -585,7 +585,7 @@ class JSCodeGen()(implicit ctx: Context) {
585585
ctx.debuglog("")
586586

587587
val jsParams = for (param <- paramsSyms) yield {
588-
implicit val pos = param.pos
588+
implicit val pos = param.span
589589
js.ParamDef(encodeLocalSym(param), toIRType(param.info),
590590
mutable = false, rest = false)
591591
}

compiler/src/dotty/tools/dotc/ast/TreeInfo.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -663,11 +663,11 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
663663
* if no such path exists.
664664
* Pre: `sym` must have a position.
665665
*/
666-
def defPath(sym: Symbol, root: Tree)(implicit ctx: Context): List[Tree] = trace.onDebug(s"defpath($sym with position ${sym.pos}, ${root.show})") {
667-
require(sym.pos.exists)
666+
def defPath(sym: Symbol, root: Tree)(implicit ctx: Context): List[Tree] = trace.onDebug(s"defpath($sym with position ${sym.span}, ${root.show})") {
667+
require(sym.span.exists)
668668
object accum extends TreeAccumulator[List[Tree]] {
669669
def apply(x: List[Tree], tree: Tree)(implicit ctx: Context): List[Tree] = {
670-
if (tree.span.contains(sym.pos))
670+
if (tree.span.contains(sym.span))
671671
if (definedSym(tree) == sym) tree :: x
672672
else {
673673
val x1 = foldOver(x, tree)
@@ -716,7 +716,7 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
716716
* tree must be reachable from come tree stored in an enclosing context.
717717
*/
718718
def definingStats(sym: Symbol)(implicit ctx: Context): List[Tree] =
719-
if (!sym.pos.exists || (ctx eq NoContext) || ctx.compilationUnit == null) Nil
719+
if (!sym.span.exists || (ctx eq NoContext) || ctx.compilationUnit == null) Nil
720720
else defPath(sym, ctx.compilationUnit.tpdTree) match {
721721
case defn :: encl :: _ =>
722722
def verify(stats: List[Tree]) =

compiler/src/dotty/tools/dotc/ast/tpd.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
314314
if (parents.head.classSymbol.is(Trait)) parents.head.parents.head :: parents
315315
else parents
316316
val cls = ctx.newNormalizedClassSymbol(owner, tpnme.ANON_CLASS, Synthetic | Final, parents1,
317-
coord = fns.map(_.pos).reduceLeft(_ union _))
317+
coord = fns.map(_.span).reduceLeft(_ union _))
318318
val constr = ctx.newConstructor(cls, Synthetic, Nil, Nil).entered
319319
def forwarder(fn: TermSymbol, name: TermName) = {
320320
val fwdMeth = fn.copy(cls, name, Synthetic | Method | Final).entered.asTerm

compiler/src/dotty/tools/dotc/core/Comments.scala

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ object Comments {
4040
* A `Comment` contains the unformatted docstring, it's position and potentially more
4141
* information that is populated when the comment is "cooked".
4242
*
43-
* @param pos The position of this `Comment`.
43+
* @param span The position span of this `Comment`.
4444
* @param raw The raw comment, as seen in the source code, without any expansion.
4545
* @param expanded If this comment has been expanded, it's expansion, otherwise `None`.
4646
* @param usecases The usecases for this comment.
4747
*/
48-
final case class Comment(pos: Span, raw: String, expanded: Option[String], usecases: List[UseCase]) {
48+
final case class Comment(span: Span, raw: String, expanded: Option[String], usecases: List[UseCase]) {
4949

5050
/** Has this comment been cooked or expanded? */
5151
def isExpanded: Boolean = expanded.isDefined
@@ -65,25 +65,25 @@ object Comments {
6565
*/
6666
def expand(f: String => String)(implicit ctx: Context): Comment = {
6767
val expandedComment = f(raw)
68-
val useCases = Comment.parseUsecases(expandedComment, pos)
69-
Comment(pos, raw, Some(expandedComment), useCases)
68+
val useCases = Comment.parseUsecases(expandedComment, span)
69+
Comment(span, raw, Some(expandedComment), useCases)
7070
}
7171
}
7272

7373
object Comment {
7474

7575
def isDocComment(comment: String): Boolean = comment.startsWith("/**")
7676

77-
def apply(pos: Span, raw: String): Comment =
78-
Comment(pos, raw, None, Nil)
77+
def apply(span: Span, raw: String): Comment =
78+
Comment(span, raw, None, Nil)
7979

80-
private def parseUsecases(expandedComment: String, pos: Span)(implicit ctx: Context): List[UseCase] =
80+
private def parseUsecases(expandedComment: String, span: Span)(implicit ctx: Context): List[UseCase] =
8181
if (!isDocComment(expandedComment)) {
8282
Nil
8383
} else {
8484
tagIndex(expandedComment)
8585
.filter { startsWithTag(expandedComment, _, "@usecase") }
86-
.map { case (start, end) => decomposeUseCase(expandedComment, pos, start, end) }
86+
.map { case (start, end) => decomposeUseCase(expandedComment, span, start, end) }
8787
}
8888

8989
/** Turns a usecase section into a UseCase, with code changed to:
@@ -94,13 +94,13 @@ object Comments {
9494
* def foo: A = ???
9595
* }}}
9696
*/
97-
private[this] def decomposeUseCase(body: String, pos: Span, start: Int, end: Int)(implicit ctx: Context): UseCase = {
97+
private[this] def decomposeUseCase(body: String, span: Span, start: Int, end: Int)(implicit ctx: Context): UseCase = {
9898
def subPos(start: Int, end: Int) =
99-
if (pos == NoSpan) NoSpan
99+
if (span == NoSpan) NoSpan
100100
else {
101-
val start1 = pos.start + start
102-
val end1 = pos.end + end
103-
pos withStart start1 withPoint start1 withEnd end1
101+
val start1 = span.start + start
102+
val end1 = span.end + end
103+
span withStart start1 withPoint start1 withEnd end1
104104
}
105105

106106
val codeStart = skipWhitespace(body, start + "@usecase".length)
@@ -199,7 +199,7 @@ object Comments {
199199
case None =>
200200
// SI-8210 - The warning would be false negative when this symbol is a setter
201201
if (ownComment.indexOf("@inheritdoc") != -1 && ! sym.isSetter)
202-
dottydoc.println(s"${sym.pos}: the comment for ${sym} contains @inheritdoc, but no parent comment is available to inherit from.")
202+
dottydoc.println(s"${sym.span}: the comment for ${sym} contains @inheritdoc, but no parent comment is available to inherit from.")
203203
ownComment.replaceAllLiterally("@inheritdoc", "<invalid inheritdoc annotation>")
204204
case Some(sc) =>
205205
if (ownComment == "") sc
@@ -314,7 +314,7 @@ object Comments {
314314
val sectionTextBounds = extractSectionText(parent, section)
315315
cleanupSectionText(parent.substring(sectionTextBounds._1, sectionTextBounds._2))
316316
case None =>
317-
dottydoc.println(s"""${sym.pos}: the """" + getSectionHeader + "\" annotation of the " + sym +
317+
dottydoc.println(s"""${sym.span}: the """" + getSectionHeader + "\" annotation of the " + sym +
318318
" comment contains @inheritdoc, but the corresponding section in the parent is not defined.")
319319
"<invalid inheritdoc annotation>"
320320
}
@@ -442,7 +442,7 @@ object Comments {
442442
* the position of the doc comment of the overridden version is returned instead.
443443
*/
444444
def docCommentPos(sym: Symbol)(implicit ctx: Context): Span =
445-
ctx.docCtx.flatMap(_.docstring(sym).map(_.pos)).getOrElse(NoSpan)
445+
ctx.docCtx.flatMap(_.docstring(sym).map(_.span)).getOrElse(NoSpan)
446446

447447
/** A version which doesn't consider self types, as a temporary measure:
448448
* an infinite loop has broken out between superComment and cookedDocComment

compiler/src/dotty/tools/dotc/core/Symbols.scala

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,8 @@ trait Symbols { this: Context =>
212212
/** Define a new symbol associated with a Bind or pattern wildcard and
213213
* make it gadt narrowable.
214214
*/
215-
def newPatternBoundSymbol(name: Name, info: Type, pos: Span): Symbol = {
216-
val sym = newSymbol(owner, name, Case, info, coord = pos)
215+
def newPatternBoundSymbol(name: Name, info: Type, span: Span): Symbol = {
216+
val sym = newSymbol(owner, name, Case, info, coord = span)
217217
if (name.isTypeName) {
218218
val bounds = info.bounds
219219
gadt.addBound(sym, bounds.lo, isUpper = false)
@@ -498,7 +498,7 @@ object Symbols {
498498

499499
/** Does this symbol come from a currently compiled source file? */
500500
final def isDefinedInCurrentRun(implicit ctx: Context): Boolean =
501-
pos.exists && defRunId == ctx.runId && {
501+
span.exists && defRunId == ctx.runId && {
502502
val file = associatedFile
503503
file != null && ctx.run.files.contains(file)
504504
}
@@ -663,14 +663,13 @@ object Symbols {
663663
denot.owner.sourceSymbol
664664
else this
665665

666-
/** The position of this symbol, or NoPosition if the symbol was not loaded
666+
/** The position of this symbol, or NoSpan if the symbol was not loaded
667667
* from source or from TASTY. This is always a zero-extent position.
668668
*
669669
* NOTE: If the symbol was not loaded from the current compilation unit,
670670
* the implicit conversion `sourcePos` will return the wrong result, careful!
671-
* TODO: Consider changing this method return type to `SourcePosition`.
672671
*/
673-
final def pos: Span = if (coord.isPosition) coord.toPosition else NoSpan
672+
final def span: Span = if (coord.isSpan) coord.toSpan else NoSpan
674673

675674
final def sourcePos(implicit ctx: Context): SourcePosition = {
676675
val source = {
@@ -680,7 +679,7 @@ object Symbols {
680679
ctx.source
681680
else ctx.getSource(f)
682681
}
683-
source.atSpan(pos)
682+
source.atSpan(span)
684683
}
685684

686685
// ParamInfo types and methods

compiler/src/dotty/tools/dotc/core/tasty/CommentPickler.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class CommentPickler(pickler: TastyPickler, addrOfTree: tpd.Tree => Option[Addr]
2323
buf.writeAddr(addr)
2424
buf.writeNat(length)
2525
buf.writeBytes(bytes, length)
26-
buf.writeLongInt(cmt.pos.coords)
26+
buf.writeLongInt(cmt.span.coords)
2727
case other =>
2828
()
2929
}

compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2103,7 +2103,7 @@ object messages {
21032103
case _ /* Signature.FullMatch */ => "\nThe definitions have matching type signatures after erasure."
21042104
}
21052105
} else ""
2106-
hl"${decl.showLocated} is already defined as ${previousDecl.showDcl} ${if (previousDecl.pos.exists) s"at line ${previousDecl.sourcePos.line + 1}" else ""}." + details
2106+
hl"${decl.showLocated} is already defined as ${previousDecl.showDcl} ${if (previousDecl.span.exists) s"at line ${previousDecl.sourcePos.line + 1}" else ""}." + details
21072107
}
21082108
val explanation: String = ""
21092109
}

compiler/src/dotty/tools/dotc/transform/AccessProxies.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ abstract class AccessProxies {
5353
accessRef.becomes(forwardedArgss.head.head)
5454
else
5555
accessRef.appliedToTypes(forwardedTypes).appliedToArgss(forwardedArgss)
56-
rhs.withSpan(accessed.pos)
56+
rhs.withSpan(accessed.span)
5757
})
5858

5959
/** Add all needed accessors to the `body` of class `cls` */
@@ -75,8 +75,8 @@ abstract class AccessProxies {
7575
}
7676

7777
/** A fresh accessor symbol */
78-
private def newAccessorSymbol(owner: Symbol, name: TermName, info: Type, pos: Span)(implicit ctx: Context): TermSymbol = {
79-
val sym = ctx.newSymbol(owner, name, Synthetic | Method, info, coord = pos).entered
78+
private def newAccessorSymbol(owner: Symbol, name: TermName, info: Type, span: Span)(implicit ctx: Context): TermSymbol = {
79+
val sym = ctx.newSymbol(owner, name, Synthetic | Method, info, coord = span).entered
8080
if (sym.allOverriddenSymbols.exists(!_.is(Deferred))) sym.setFlag(Override)
8181
sym
8282
}
@@ -85,7 +85,7 @@ abstract class AccessProxies {
8585
protected def accessorSymbol(owner: Symbol, accessorName: TermName, accessorInfo: Type, accessed: Symbol)(implicit ctx: Context): Symbol = {
8686
def refersToAccessed(sym: Symbol) = accessedBy.get(sym).contains(accessed)
8787
owner.info.decl(accessorName).suchThat(refersToAccessed).symbol.orElse {
88-
val acc = newAccessorSymbol(owner, accessorName, accessorInfo, accessed.pos)
88+
val acc = newAccessorSymbol(owner, accessorName, accessorInfo, accessed.span)
8989
accessedBy(acc) = accessed
9090
acc
9191
}

compiler/src/dotty/tools/dotc/transform/Bridges.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class Bridges(root: ClassSymbol, thisPhase: DenotTransformer)(implicit ctx: Cont
4242
private val bridgeTarget = newMutableSymbolMap[Symbol]
4343

4444
def bridgePosFor(member: Symbol): SourcePosition =
45-
(if (member.owner == root && member.pos.exists) member else root).sourcePos
45+
(if (member.owner == root && member.span.exists) member else root).sourcePos
4646

4747
/** Add a bridge between `member` and `other`, where `member` overrides `other`
4848
* before erasure, if the following conditions are satisfied.
@@ -90,7 +90,7 @@ class Bridges(root: ClassSymbol, thisPhase: DenotTransformer)(implicit ctx: Cont
9090

9191
ctx.debuglog(
9292
i"""generating bridge from ${other.showLocated}: ${other.info}
93-
|to ${member.showLocated}: ${member.info} @ ${member.pos}
93+
|to ${member.showLocated}: ${member.info} @ ${member.span}
9494
|bridge: ${bridge.showLocated} with flags: ${bridge.flags}""")
9595

9696
bridgeTarget(bridge) = member
@@ -107,7 +107,7 @@ class Bridges(root: ClassSymbol, thisPhase: DenotTransformer)(implicit ctx: Cont
107107
else ref.appliedToArgss(argss)
108108
}
109109

110-
bridges += DefDef(bridge, bridgeRhs(_).withSpan(bridge.pos))
110+
bridges += DefDef(bridge, bridgeRhs(_).withSpan(bridge.span))
111111
}
112112

113113
/** Add all necessary bridges to template statements `stats`, and remove at the same

compiler/src/dotty/tools/dotc/transform/Mixin.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ class Mixin extends MiniPhase with SymTransformer { thisPhase =>
250250

251251
def setters(mixin: ClassSymbol): List[Tree] =
252252
for (setter <- mixin.info.decls.filter(setr => setr.isSetter && !was(setr, Deferred)))
253-
yield transformFollowing(DefDef(implementation(setter.asTerm), unitLiteral.withSpan(cls.pos)))
253+
yield transformFollowing(DefDef(implementation(setter.asTerm), unitLiteral.withSpan(cls.span)))
254254

255255
cpy.Template(impl)(
256256
constr =

compiler/src/dotty/tools/dotc/transform/MixinOps.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ class MixinOps(cls: ClassSymbol, thisPhase: DenotTransformer)(implicit ctx: Cont
2828
res
2929
}
3030

31-
def superRef(target: Symbol, pos: Span = cls.pos): Tree = {
31+
def superRef(target: Symbol, span: Span = cls.span): Tree = {
3232
val sup = if (target.isConstructor && !target.owner.is(Trait))
3333
Super(This(cls), tpnme.EMPTY, true)
3434
else
3535
Super(This(cls), target.owner.name.asTypeName, false, target.owner)
3636
//println(i"super ref $target on $sup")
37-
ast.untpd.Select(sup.withSpan(pos), target.name)
37+
ast.untpd.Select(sup.withSpan(span), target.name)
3838
.withType(NamedType(sup.tpe, target))
3939
//sup.select(target)
4040
}

compiler/src/dotty/tools/dotc/transform/NonLocalReturns.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class NonLocalReturns extends MiniPhase {
3737
private def nonLocalReturnKey(meth: Symbol)(implicit ctx: Context) =
3838
nonLocalReturnKeys.getOrElseUpdate(meth,
3939
ctx.newSymbol(
40-
meth, NonLocalReturnKeyName.fresh(), Synthetic, defn.ObjectType, coord = meth.pos))
40+
meth, NonLocalReturnKeyName.fresh(), Synthetic, defn.ObjectType, coord = meth.span))
4141

4242
/** Generate a non-local return throw with given return expression from given method.
4343
* I.e. for the method's non-local return key, generate:

compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ object PatternMatcher {
256256
def matchElemsPlan(seqSym: Symbol, args: List[Tree], exact: Boolean, onSuccess: Plan) = {
257257
val selectors = args.indices.toList.map(idx =>
258258
ref(seqSym).select(defn.Seq_apply.matchingMember(seqSym.info)).appliedTo(Literal(Constant(idx))))
259-
TestPlan(LengthTest(args.length, exact), seqSym, seqSym.pos,
259+
TestPlan(LengthTest(args.length, exact), seqSym, seqSym.span,
260260
matchArgsPlan(selectors, args, onSuccess))
261261
}
262262

compiler/src/dotty/tools/dotc/transform/SyntheticMethods.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class SyntheticMethods(thisPhase: DenotTransformer) {
9494
case nme.productElement => vrefss => productElementBody(accessors.length, vrefss.head.head)
9595
}
9696
ctx.log(s"adding $synthetic to $clazz at ${ctx.phase}")
97-
DefDef(synthetic, syntheticRHS(ctx.withOwner(synthetic))).withSpan(ctx.owner.pos.focus)
97+
DefDef(synthetic, syntheticRHS(ctx.withOwner(synthetic))).withSpan(ctx.owner.span.focus)
9898
}
9999

100100
/** The class
@@ -158,7 +158,7 @@ class SyntheticMethods(thisPhase: DenotTransformer) {
158158
*
159159
*/
160160
def equalsBody(that: Tree)(implicit ctx: Context): Tree = {
161-
val thatAsClazz = ctx.newSymbol(ctx.owner, nme.x_0, Synthetic, clazzType, coord = ctx.owner.pos) // x$0
161+
val thatAsClazz = ctx.newSymbol(ctx.owner, nme.x_0, Synthetic, clazzType, coord = ctx.owner.span) // x$0
162162
def wildcardAscription(tp: Type) = Typed(Underscore(tp), TypeTree(tp))
163163
val pattern = Bind(thatAsClazz, wildcardAscription(AnnotatedType(clazzType, Annotation(defn.UncheckedAnnot)))) // x$0 @ (_: C @unchecked)
164164
val comparisons = accessors map { accessor =>
@@ -213,7 +213,7 @@ class SyntheticMethods(thisPhase: DenotTransformer) {
213213
def caseHashCodeBody(implicit ctx: Context): Tree = {
214214
val seed = clazz.fullName.toString.hashCode
215215
if (accessors.nonEmpty) {
216-
val acc = ctx.newSymbol(ctx.owner, "acc".toTermName, Mutable | Synthetic, defn.IntType, coord = ctx.owner.pos)
216+
val acc = ctx.newSymbol(ctx.owner, "acc".toTermName, Mutable | Synthetic, defn.IntType, coord = ctx.owner.span)
217217
val accDef = ValDef(acc, Literal(Constant(seed)))
218218
val mixes = for (accessor <- accessors) yield
219219
Assign(ref(acc), ref(defn.staticsMethod("mix")).appliedTo(ref(acc), hashImpl(accessor)))

compiler/src/dotty/tools/dotc/typer/Applications.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1234,7 +1234,7 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
12341234
// `isSubType` as a TypeVar might get constrained by a TypeRef it's
12351235
// part of.
12361236
val tp1Params = tp1.newLikeThis(tp1.paramNames, tp1.paramInfos, defn.AnyType)
1237-
fullyDefinedType(tp1Params, "type parameters of alternative", alt1.symbol.pos)
1237+
fullyDefinedType(tp1Params, "type parameters of alternative", alt1.symbol.span)
12381238

12391239
val tparams = ctx.newTypeParams(alt1.symbol, tp1.paramNames, EmptyFlags, tp1.instantiateParamInfos(_))
12401240
isAsSpecific(alt1, tp1.instantiate(tparams.map(_.typeRef)), alt2, tp2)

compiler/src/dotty/tools/dotc/typer/Inliner.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(implicit ctx: Context) {
698698
*/
699699
def newBinding(sym: TermSymbol, rhs: Tree): Unit = {
700700
sym.info = rhs.tpe.widenTermRefExpr
701-
bindingsBuf += ValDef(sym, constToLiteral(rhs)).withSpan(sym.pos)
701+
bindingsBuf += ValDef(sym, constToLiteral(rhs)).withSpan(sym.span)
702702
}
703703

704704
def searchImplicit(sym: TermSymbol, tpt: Tree) = {

0 commit comments

Comments
 (0)