@@ -127,7 +127,7 @@ class JSCodeGen()(implicit ctx: Context) {
127
127
/* Finally, we emit true code for the remaining class defs. */
128
128
for (td <- allTypeDefs) {
129
129
val sym = td.symbol
130
- implicit val pos : Position = sym.pos
130
+ implicit val pos = sym.pos
131
131
132
132
/* Do not actually emit code for primitive types nor scala.Array. */
133
133
val isPrimitive =
@@ -203,7 +203,7 @@ class JSCodeGen()(implicit ctx: Context) {
203
203
*/
204
204
private def genScalaClass (td : TypeDef ): js.ClassDef = {
205
205
val sym = td.symbol.asClass
206
- implicit val pos : Position = sym.pos
206
+ implicit val pos = sym.pos
207
207
208
208
assert(! sym.is(Trait ),
209
209
" genScalaClass() must be called only for normal classes: " + sym)
@@ -336,7 +336,7 @@ class JSCodeGen()(implicit ctx: Context) {
336
336
*/
337
337
private def genRawJSClassData (td : TypeDef ): js.ClassDef = {
338
338
val sym = td.symbol.asClass
339
- implicit val pos : Position = sym.pos
339
+ implicit val pos = sym.pos
340
340
341
341
val classIdent = encodeClassFullNameIdent(sym)
342
342
val superClass =
@@ -358,7 +358,7 @@ class JSCodeGen()(implicit ctx: Context) {
358
358
*/
359
359
private def genInterface (td : TypeDef ): js.ClassDef = {
360
360
val sym = td.symbol.asClass
361
- implicit val pos : Position = sym.pos
361
+ implicit val pos = sym.pos
362
362
363
363
val classIdent = encodeClassFullNameIdent(sym)
364
364
@@ -408,7 +408,7 @@ class JSCodeGen()(implicit ctx: Context) {
408
408
f <- classSym.info.decls
409
409
if ! f.is(Method ) && f.isTerm
410
410
} yield {
411
- implicit val pos : Position = f.pos
411
+ implicit val pos = f.pos
412
412
413
413
val name =
414
414
/* if (isExposed(f)) js.StringLiteral(jsNameOf(f))
@@ -479,7 +479,7 @@ class JSCodeGen()(implicit ctx: Context) {
479
479
* Other (normal) methods are emitted with `genMethodBody()`.
480
480
*/
481
481
private def genMethodWithCurrentLocalNameScope (dd : DefDef ): Option [js.MethodDef ] = {
482
- implicit val pos : Position = dd.pos
482
+ implicit val pos = dd.pos
483
483
val sym = dd.symbol
484
484
val vparamss = dd.vparamss
485
485
val rhs = dd.rhs
@@ -501,7 +501,7 @@ class JSCodeGen()(implicit ctx: Context) {
501
501
val methodName : js.PropertyName = encodeMethodSym(sym)
502
502
503
503
def jsParams = for (param <- params) yield {
504
- implicit val pos : Position = param.pos
504
+ implicit val pos = param.pos
505
505
js.ParamDef (encodeLocalSym(param), toIRType(param.info),
506
506
mutable = false , rest = false )
507
507
}
@@ -574,13 +574,13 @@ class JSCodeGen()(implicit ctx: Context) {
574
574
private def genMethodDef (static : Boolean , methodName : js.PropertyName ,
575
575
paramsSyms : List [Symbol ], resultIRType : jstpe.Type ,
576
576
tree : Tree , optimizerHints : OptimizerHints ): js.MethodDef = {
577
- implicit val pos : Position = tree.pos
577
+ implicit val pos = tree.pos
578
578
579
579
ctx.debuglog(" genMethod " + methodName.name)
580
580
ctx.debuglog(" " )
581
581
582
582
val jsParams = for (param <- paramsSyms) yield {
583
- implicit val pos : Position = param.pos
583
+ implicit val pos = param.pos
584
584
js.ParamDef (encodeLocalSym(param), toIRType(param.info),
585
585
mutable = false , rest = false )
586
586
}
@@ -621,7 +621,7 @@ class JSCodeGen()(implicit ctx: Context) {
621
621
/* Any JavaScript expression is also a statement, but at least we get rid
622
622
* of some pure expressions that come from our own codegen.
623
623
*/
624
- implicit val pos : Position = tree.pos
624
+ implicit val pos = tree.pos
625
625
tree match {
626
626
case js.Block (stats :+ expr) => js.Block (stats :+ exprToStat(expr))
627
627
case _:js.Literal | js.This () => js.Skip ()
@@ -644,7 +644,7 @@ class JSCodeGen()(implicit ctx: Context) {
644
644
* is transformed into an equivalent portion of the JS AST.
645
645
*/
646
646
private def genStatOrExpr (tree : Tree , isStat : Boolean ): js.Tree = {
647
- implicit val pos : Position = tree.pos
647
+ implicit val pos = tree.pos
648
648
649
649
ctx.debuglog(" " + tree)
650
650
ctx.debuglog(" " )
@@ -902,7 +902,7 @@ class JSCodeGen()(implicit ctx: Context) {
902
902
* primitives, JS calls, etc. They are further dispatched in here.
903
903
*/
904
904
private def genApply (tree : Apply , isStat : Boolean ): js.Tree = {
905
- implicit val pos : Position = tree.pos
905
+ implicit val pos = tree.pos
906
906
val args = tree.args
907
907
val sym = tree.fun.symbol
908
908
@@ -951,7 +951,7 @@ class JSCodeGen()(implicit ctx: Context) {
951
951
* irrelevant.
952
952
*/
953
953
private def genSuperCall (tree : Apply , isStat : Boolean ): js.Tree = {
954
- implicit val pos : Position = tree.pos
954
+ implicit val pos = tree.pos
955
955
val Apply (fun @ Select (sup @ Super (_, mix), _), args) = tree
956
956
val sym = fun.symbol
957
957
@@ -987,7 +987,7 @@ class JSCodeGen()(implicit ctx: Context) {
987
987
* * regular new
988
988
*/
989
989
private def genApplyNew (tree : Apply ): js.Tree = {
990
- implicit val pos : Position = tree.pos
990
+ implicit val pos = tree.pos
991
991
992
992
val Apply (fun @ Select (New (tpt), nme.CONSTRUCTOR ), args) = tree
993
993
val ctor = fun.symbol
@@ -1023,7 +1023,7 @@ class JSCodeGen()(implicit ctx: Context) {
1023
1023
private def genPrimitiveOp (tree : Apply , isStat : Boolean ): js.Tree = {
1024
1024
import scala .tools .nsc .backend .ScalaPrimitives ._
1025
1025
1026
- implicit val pos : Position = tree.pos
1026
+ implicit val pos = tree.pos
1027
1027
1028
1028
val Apply (fun, args) = tree
1029
1029
val receiver = qualifierOf(fun)
@@ -1063,7 +1063,7 @@ class JSCodeGen()(implicit ctx: Context) {
1063
1063
private def genSimpleUnaryOp (tree : Apply , arg : Tree , code : Int ): js.Tree = {
1064
1064
import scala .tools .nsc .backend .ScalaPrimitives ._
1065
1065
1066
- implicit val pos : Position = tree.pos
1066
+ implicit val pos = tree.pos
1067
1067
1068
1068
val genArg = genExpr(arg)
1069
1069
val resultIRType = toIRType(tree.tpe)
@@ -1118,7 +1118,7 @@ class JSCodeGen()(implicit ctx: Context) {
1118
1118
}
1119
1119
import OpTypes ._
1120
1120
1121
- implicit val pos : Position = tree.pos
1121
+ implicit val pos = tree.pos
1122
1122
1123
1123
val lhsIRType = toIRType(lhs.tpe)
1124
1124
val rhsIRType = toIRType(rhs.tpe)
@@ -1374,7 +1374,7 @@ class JSCodeGen()(implicit ctx: Context) {
1374
1374
*/
1375
1375
private def genStringConcat (tree : Apply , receiver : Tree ,
1376
1376
args : List [Tree ]): js.Tree = {
1377
- implicit val pos : Position = tree.pos
1377
+ implicit val pos = tree.pos
1378
1378
1379
1379
val arg = args.head
1380
1380
@@ -1401,7 +1401,7 @@ class JSCodeGen()(implicit ctx: Context) {
1401
1401
1402
1402
/** Gen JS code for a call to Any.## */
1403
1403
private def genScalaHash (tree : Apply , receiver : Tree ): js.Tree = {
1404
- implicit val pos : Position = tree.pos
1404
+ implicit val pos = tree.pos
1405
1405
1406
1406
genModuleApplyMethod(defn.ScalaRuntimeModule .requiredMethod(nme.hash_),
1407
1407
List (genExpr(receiver)))
@@ -1411,7 +1411,7 @@ class JSCodeGen()(implicit ctx: Context) {
1411
1411
private def genArrayOp (tree : Tree , code : Int ): js.Tree = {
1412
1412
import scala .tools .nsc .backend .ScalaPrimitives ._
1413
1413
1414
- implicit val pos : Position = tree.pos
1414
+ implicit val pos = tree.pos
1415
1415
1416
1416
val Apply (fun, args) = tree
1417
1417
val arrayObj = qualifierOf(fun)
@@ -1462,7 +1462,7 @@ class JSCodeGen()(implicit ctx: Context) {
1462
1462
// common case for which there is no side-effect nor NPE
1463
1463
genArg
1464
1464
case _ =>
1465
- implicit val pos : Position = tree.pos
1465
+ implicit val pos = tree.pos
1466
1466
/* TODO Check for a null receiver?
1467
1467
* In theory, it's UB, but that decision should be left for link time.
1468
1468
*/
@@ -1474,7 +1474,7 @@ class JSCodeGen()(implicit ctx: Context) {
1474
1474
private def genCoercion (tree : Apply , receiver : Tree , code : Int ): js.Tree = {
1475
1475
import scala .tools .nsc .backend .ScalaPrimitives ._
1476
1476
1477
- implicit val pos : Position = tree.pos
1477
+ implicit val pos = tree.pos
1478
1478
1479
1479
val source = genExpr(receiver)
1480
1480
@@ -1544,7 +1544,7 @@ class JSCodeGen()(implicit ctx: Context) {
1544
1544
1545
1545
/** Gen a call to the special `throw` method. */
1546
1546
private def genThrow (tree : Apply , args : List [Tree ]): js.Tree = {
1547
- implicit val pos : Position = tree.pos
1547
+ implicit val pos = tree.pos
1548
1548
val exception = args.head
1549
1549
val genException = genExpr(exception)
1550
1550
js.Throw {
@@ -1568,7 +1568,7 @@ class JSCodeGen()(implicit ctx: Context) {
1568
1568
* * Regular method call
1569
1569
*/
1570
1570
private def genNormalApply (tree : Apply , isStat : Boolean ): js.Tree = {
1571
- implicit val pos : Position = tree.pos
1571
+ implicit val pos = tree.pos
1572
1572
1573
1573
val fun = tree.fun match {
1574
1574
case fun : Ident => desugarIdent(fun).get
@@ -1616,7 +1616,7 @@ class JSCodeGen()(implicit ctx: Context) {
1616
1616
superIn : Option [Symbol ] = None )(
1617
1617
implicit pos : Position ): js.Tree = {
1618
1618
1619
- implicit val pos : Position = tree.pos
1619
+ implicit val pos = tree.pos
1620
1620
1621
1621
def noSpread = ! args.exists(_.isInstanceOf [js.JSSpread ])
1622
1622
val argc = args.size // meaningful only for methods that don't have varargs
@@ -1775,7 +1775,7 @@ class JSCodeGen()(implicit ctx: Context) {
1775
1775
* primitive instead.)
1776
1776
*/
1777
1777
private def genTypeApply (tree : TypeApply ): js.Tree = {
1778
- implicit val pos : Position = tree.pos
1778
+ implicit val pos = tree.pos
1779
1779
1780
1780
val TypeApply (fun, targs) = tree
1781
1781
@@ -1803,7 +1803,7 @@ class JSCodeGen()(implicit ctx: Context) {
1803
1803
1804
1804
/** Gen JS code for a Java Seq literal. */
1805
1805
private def genJavaSeqLiteral (tree : JavaSeqLiteral ): js.Tree = {
1806
- implicit val pos : Position = tree.pos
1806
+ implicit val pos = tree.pos
1807
1807
1808
1808
val genElems = tree.elems.map(genExpr)
1809
1809
val arrayType = toReferenceType(tree.tpe).asInstanceOf [jstpe.ArrayType ]
@@ -1852,7 +1852,7 @@ class JSCodeGen()(implicit ctx: Context) {
1852
1852
* available in the `body`.
1853
1853
*/
1854
1854
private def genClosure (tree : Closure ): js.Tree = {
1855
- implicit val pos : Position = tree.pos
1855
+ implicit val pos = tree.pos
1856
1856
val Closure (env, call, functionalInterface) = tree
1857
1857
1858
1858
val envSize = env.size
@@ -1868,7 +1868,7 @@ class JSCodeGen()(implicit ctx: Context) {
1868
1868
val allCaptureValues = qualifier :: env
1869
1869
1870
1870
val (formalCaptures, actualCaptures) = allCaptureValues.map { value =>
1871
- implicit val pos : Position = value.pos
1871
+ implicit val pos = value.pos
1872
1872
val formalIdent = value match {
1873
1873
case Ident (name) => freshLocalIdent(name.toString)
1874
1874
case This (_) => freshLocalIdent(" this" )
@@ -1988,7 +1988,7 @@ class JSCodeGen()(implicit ctx: Context) {
1988
1988
1989
1989
/** Gen JS code for an isInstanceOf test (for reference types only) */
1990
1990
private def genIsInstanceOf (tree : Tree , value : js.Tree , to : Type ): js.Tree = {
1991
- implicit val pos : Position = tree.pos
1991
+ implicit val pos = tree.pos
1992
1992
val sym = to.widenDealias.typeSymbol
1993
1993
1994
1994
if (sym == defn.ObjectClass ) {
@@ -2242,7 +2242,7 @@ class JSCodeGen()(implicit ctx: Context) {
2242
2242
* to perform the conversion to js.Array, then wrap in a Spread
2243
2243
* operator.
2244
2244
*/
2245
- implicit val pos : Position = arg.pos
2245
+ implicit val pos = arg.pos
2246
2246
val jsArrayArg = genModuleApplyMethod(
2247
2247
jsdefn.RuntimePackage_genTraversableOnce2jsArray ,
2248
2248
List (genExpr(arg)))
@@ -2259,7 +2259,7 @@ class JSCodeGen()(implicit ctx: Context) {
2259
2259
*/
2260
2260
private def tryGenRepeatedParamAsJSArray (arg : Tree ,
2261
2261
handleNil : Boolean ): Option [List [js.Tree ]] = {
2262
- implicit val pos : Position = arg.pos
2262
+ implicit val pos = arg.pos
2263
2263
2264
2264
// Given a method `def foo(args: T*)`
2265
2265
arg match {
0 commit comments