@@ -484,7 +484,7 @@ class JSCodeGen()(implicit ctx: Context) {
484
484
* Other (normal) methods are emitted with `genMethodBody()`.
485
485
*/
486
486
private def genMethodWithCurrentLocalNameScope (dd : DefDef ): Option [js.MethodDef ] = {
487
- implicit val pos = dd.pos
487
+ implicit val pos = dd.span
488
488
val sym = dd.symbol
489
489
val vparamss = dd.vparamss
490
490
val rhs = dd.rhs
@@ -579,7 +579,7 @@ class JSCodeGen()(implicit ctx: Context) {
579
579
private def genMethodDef (static : Boolean , methodName : js.PropertyName ,
580
580
paramsSyms : List [Symbol ], resultIRType : jstpe.Type ,
581
581
tree : Tree , optimizerHints : OptimizerHints ): js.MethodDef = {
582
- implicit val pos = tree.pos
582
+ implicit val pos = tree.span
583
583
584
584
ctx.debuglog(" genMethod " + methodName.encodedName)
585
585
ctx.debuglog(" " )
@@ -598,7 +598,7 @@ class JSCodeGen()(implicit ctx: Context) {
598
598
js.MethodDef (static, methodName, jsParams, resultIRType, Some (genBody()))(
599
599
optimizerHints, None )
600
600
/* } else {
601
- assert(!static, tree.pos )
601
+ assert(!static, tree.span )
602
602
603
603
withScopedVars(
604
604
thisLocalVarIdent := Some(freshLocalIdent("this"))
@@ -639,7 +639,7 @@ class JSCodeGen()(implicit ctx: Context) {
639
639
private def genExpr (tree : Tree ): js.Tree = {
640
640
val result = genStatOrExpr(tree, isStat = false )
641
641
assert(result.tpe != jstpe.NoType ,
642
- s " genExpr( $tree) returned a tree with type NoType at pos ${tree.pos }" )
642
+ s " genExpr( $tree) returned a tree with type NoType at pos ${tree.span }" )
643
643
result
644
644
}
645
645
@@ -649,7 +649,7 @@ class JSCodeGen()(implicit ctx: Context) {
649
649
* is transformed into an equivalent portion of the JS AST.
650
650
*/
651
651
private def genStatOrExpr (tree : Tree , isStat : Boolean ): js.Tree = {
652
- implicit val pos = tree.pos
652
+ implicit val pos = tree.span
653
653
654
654
ctx.debuglog(" " + tree)
655
655
ctx.debuglog(" " )
@@ -660,7 +660,7 @@ class JSCodeGen()(implicit ctx: Context) {
660
660
/* Must have been eliminated by the tail call transform performed
661
661
* by genMethodBody(). */
662
662
assert(name != nme.THIS ,
663
- s " ValDef(_, nme.THIS, _, _) found at ${tree.pos }" )
663
+ s " ValDef(_, nme.THIS, _, _) found at ${tree.span }" )
664
664
665
665
val sym = tree.symbol
666
666
val rhs = tree.rhs
@@ -719,7 +719,7 @@ class JSCodeGen()(implicit ctx: Context) {
719
719
" Trying to access the this of another class: " +
720
720
" tree.symbol = " + tree.symbol +
721
721
" , class symbol = " + currentClassSym.get +
722
- " pos :" + pos)
722
+ " span :" + pos)
723
723
genLoadModule(tree.symbol)
724
724
}
725
725
@@ -856,7 +856,7 @@ class JSCodeGen()(implicit ctx: Context) {
856
856
857
857
case _ =>
858
858
throw new FatalError (" Unexpected tree in genExpr: " +
859
- tree + " /" + tree.getClass + " at: " + (tree.pos : Position ))
859
+ tree + " /" + tree.getClass + " at: " + (tree.span : Position ))
860
860
}
861
861
} // end of genStatOrExpr()
862
862
@@ -897,7 +897,7 @@ class JSCodeGen()(implicit ctx: Context) {
897
897
* primitives, JS calls, etc. They are further dispatched in here.
898
898
*/
899
899
private def genApply (tree : Apply , isStat : Boolean ): js.Tree = {
900
- implicit val pos = tree.pos
900
+ implicit val pos = tree.span
901
901
val args = tree.args
902
902
val sym = tree.fun.symbol
903
903
@@ -944,7 +944,7 @@ class JSCodeGen()(implicit ctx: Context) {
944
944
* irrelevant.
945
945
*/
946
946
private def genSuperCall (tree : Apply , isStat : Boolean ): js.Tree = {
947
- implicit val pos = tree.pos
947
+ implicit val pos = tree.span
948
948
val Apply (fun @ Select (sup @ Super (_, mix), _), args) = tree
949
949
val sym = fun.symbol
950
950
@@ -955,7 +955,7 @@ class JSCodeGen()(implicit ctx: Context) {
955
955
genJSSuperCall(tree, isStat)
956
956
} else*/ {
957
957
val superCall = genApplyMethodStatically(
958
- genThis()(sup.pos ), sym, genActualArgs(sym, args))
958
+ genThis()(sup.span ), sym, genActualArgs(sym, args))
959
959
960
960
// Initialize the module instance just after the super constructor call.
961
961
if (isStaticModule(currentClassSym) && ! isModuleInitialized &&
@@ -980,7 +980,7 @@ class JSCodeGen()(implicit ctx: Context) {
980
980
* * regular new
981
981
*/
982
982
private def genApplyNew (tree : Apply ): js.Tree = {
983
- implicit val pos = tree.pos
983
+ implicit val pos = tree.span
984
984
985
985
val Apply (fun @ Select (New (tpt), nme.CONSTRUCTOR ), args) = tree
986
986
val ctor = fun.symbol
@@ -1038,7 +1038,7 @@ class JSCodeGen()(implicit ctx: Context) {
1038
1038
private def genPrimitiveOp (tree : Apply , isStat : Boolean ): js.Tree = {
1039
1039
import scala .tools .nsc .backend .ScalaPrimitivesOps ._
1040
1040
1041
- implicit val pos = tree.pos
1041
+ implicit val pos = tree.span
1042
1042
1043
1043
val Apply (fun, args) = tree
1044
1044
val receiver = qualifierOf(fun)
@@ -1078,7 +1078,7 @@ class JSCodeGen()(implicit ctx: Context) {
1078
1078
private def genSimpleUnaryOp (tree : Apply , arg : Tree , code : Int ): js.Tree = {
1079
1079
import scala .tools .nsc .backend .ScalaPrimitivesOps ._
1080
1080
1081
- implicit val pos = tree.pos
1081
+ implicit val pos = tree.span
1082
1082
1083
1083
val resultIRType = toIRType(tree.tpe)
1084
1084
val genArg = adaptPrimitive(genExpr(arg), resultIRType)
@@ -1120,7 +1120,7 @@ class JSCodeGen()(implicit ctx: Context) {
1120
1120
import scala .tools .nsc .backend .ScalaPrimitivesOps ._
1121
1121
import js .UnaryOp ._
1122
1122
1123
- implicit val pos = tree.pos
1123
+ implicit val pos = tree.span
1124
1124
1125
1125
val lhsIRType = toIRType(lhs.tpe)
1126
1126
val rhsIRType = toIRType(rhs.tpe)
@@ -1423,7 +1423,7 @@ class JSCodeGen()(implicit ctx: Context) {
1423
1423
*/
1424
1424
private def genStringConcat (tree : Apply , receiver : Tree ,
1425
1425
args : List [Tree ]): js.Tree = {
1426
- implicit val pos = tree.pos
1426
+ implicit val pos = tree.span
1427
1427
1428
1428
val arg = args.head
1429
1429
@@ -1450,7 +1450,7 @@ class JSCodeGen()(implicit ctx: Context) {
1450
1450
1451
1451
/** Gen JS code for a call to Any.## */
1452
1452
private def genScalaHash (tree : Apply , receiver : Tree ): js.Tree = {
1453
- implicit val pos = tree.pos
1453
+ implicit val pos = tree.span
1454
1454
1455
1455
genModuleApplyMethod(defn.ScalaRuntimeModule .requiredMethod(nme.hash_),
1456
1456
List (genExpr(receiver)))
@@ -1460,7 +1460,7 @@ class JSCodeGen()(implicit ctx: Context) {
1460
1460
private def genArrayOp (tree : Tree , code : Int ): js.Tree = {
1461
1461
import scala .tools .nsc .backend .ScalaPrimitivesOps ._
1462
1462
1463
- implicit val pos = tree.pos
1463
+ implicit val pos = tree.span
1464
1464
1465
1465
val Apply (fun, args) = tree
1466
1466
val arrayObj = qualifierOf(fun)
@@ -1512,7 +1512,7 @@ class JSCodeGen()(implicit ctx: Context) {
1512
1512
// common case for which there is no side-effect nor NPE
1513
1513
genArg
1514
1514
case _ =>
1515
- implicit val pos = tree.pos
1515
+ implicit val pos = tree.span
1516
1516
/* TODO Check for a null receiver?
1517
1517
* In theory, it's UB, but that decision should be left for link time.
1518
1518
*/
@@ -1522,7 +1522,7 @@ class JSCodeGen()(implicit ctx: Context) {
1522
1522
1523
1523
/** Gen JS code for a coercion */
1524
1524
private def genCoercion (tree : Apply , receiver : Tree , code : Int ): js.Tree = {
1525
- implicit val pos = tree.pos
1525
+ implicit val pos = tree.span
1526
1526
1527
1527
val source = genExpr(receiver)
1528
1528
val resultType = toIRType(tree.tpe)
@@ -1531,7 +1531,7 @@ class JSCodeGen()(implicit ctx: Context) {
1531
1531
1532
1532
/** Gen a call to the special `throw` method. */
1533
1533
private def genThrow (tree : Apply , args : List [Tree ]): js.Tree = {
1534
- implicit val pos = tree.pos
1534
+ implicit val pos = tree.span
1535
1535
val exception = args.head
1536
1536
val genException = genExpr(exception)
1537
1537
js.Throw {
@@ -1555,7 +1555,7 @@ class JSCodeGen()(implicit ctx: Context) {
1555
1555
* * Regular method call
1556
1556
*/
1557
1557
private def genNormalApply (tree : Apply , isStat : Boolean ): js.Tree = {
1558
- implicit val pos = tree.pos
1558
+ implicit val pos = tree.span
1559
1559
1560
1560
val fun = tree.fun match {
1561
1561
case fun : Ident => desugarIdent(fun).get
@@ -1601,7 +1601,7 @@ class JSCodeGen()(implicit ctx: Context) {
1601
1601
jsSuperClassValue : Option [js.Tree ] = None )(
1602
1602
implicit pos : Position ): js.Tree = {
1603
1603
1604
- implicit val pos = tree.pos
1604
+ implicit val pos = tree.span
1605
1605
1606
1606
def noSpread = ! args.exists(_.isInstanceOf [js.JSSpread ])
1607
1607
val argc = args.size // meaningful only for methods that don't have varargs
@@ -1759,7 +1759,7 @@ class JSCodeGen()(implicit ctx: Context) {
1759
1759
* primitive instead.)
1760
1760
*/
1761
1761
private def genTypeApply (tree : TypeApply ): js.Tree = {
1762
- implicit val pos = tree.pos
1762
+ implicit val pos = tree.span
1763
1763
1764
1764
val TypeApply (fun, targs) = tree
1765
1765
@@ -1787,7 +1787,7 @@ class JSCodeGen()(implicit ctx: Context) {
1787
1787
1788
1788
/** Gen JS code for a Java Seq literal. */
1789
1789
private def genJavaSeqLiteral (tree : JavaSeqLiteral ): js.Tree = {
1790
- implicit val pos = tree.pos
1790
+ implicit val pos = tree.span
1791
1791
1792
1792
val genElems = tree.elems.map(genExpr)
1793
1793
val arrayTypeRef = toTypeRef(tree.tpe).asInstanceOf [jstpe.ArrayTypeRef ]
@@ -1836,7 +1836,7 @@ class JSCodeGen()(implicit ctx: Context) {
1836
1836
* available in the `body`.
1837
1837
*/
1838
1838
private def genClosure (tree : Closure ): js.Tree = {
1839
- implicit val pos = tree.pos
1839
+ implicit val pos = tree.span
1840
1840
val Closure (env, call, functionalInterface) = tree
1841
1841
1842
1842
val envSize = env.size
@@ -1852,7 +1852,7 @@ class JSCodeGen()(implicit ctx: Context) {
1852
1852
val allCaptureValues = qualifier :: env
1853
1853
1854
1854
val formalAndActualCaptures = allCaptureValues.map { value =>
1855
- implicit val pos = value.pos
1855
+ implicit val pos = value.span
1856
1856
val formalIdent = value match {
1857
1857
case Ident (name) => freshLocalIdent(name.toString)
1858
1858
case This (_) => freshLocalIdent(" this" )
@@ -1975,7 +1975,7 @@ class JSCodeGen()(implicit ctx: Context) {
1975
1975
1976
1976
/** Gen JS code for an isInstanceOf test (for reference types only) */
1977
1977
private def genIsInstanceOf (tree : Tree , value : js.Tree , to : Type ): js.Tree = {
1978
- implicit val pos = tree.pos
1978
+ implicit val pos = tree.span
1979
1979
val sym = to.widenDealias.typeSymbol
1980
1980
1981
1981
if (sym == defn.ObjectClass ) {
@@ -2193,7 +2193,7 @@ class JSCodeGen()(implicit ctx: Context) {
2193
2193
* to perform the conversion to js.Array, then wrap in a Spread
2194
2194
* operator.
2195
2195
*/
2196
- implicit val pos = arg.pos
2196
+ implicit val pos = arg.span
2197
2197
val jsArrayArg = genModuleApplyMethod(
2198
2198
jsdefn.Runtime_toJSVarArgs ,
2199
2199
List (genExpr(arg)))
@@ -2210,7 +2210,7 @@ class JSCodeGen()(implicit ctx: Context) {
2210
2210
*/
2211
2211
private def tryGenRepeatedParamAsJSArray (arg : Tree ,
2212
2212
handleNil : Boolean ): Option [List [js.Tree ]] = {
2213
- implicit val pos = arg.pos
2213
+ implicit val pos = arg.span
2214
2214
2215
2215
// Given a method `def foo(args: T*)`
2216
2216
arg match {
0 commit comments