@@ -151,7 +151,7 @@ class SourceCodePrinter[R <: Reflection & Singleton](val tasty: R)(syntaxHighlig
151
151
}
152
152
153
153
val parents1 = parents.filter {
154
- case Apply (Select (New (tpt), _), _) => tpt.tpe.typeSymbol != ctx .requiredClass(" java.lang.Object" )
154
+ case Apply (Select (New (tpt), _), _) => tpt.tpe.typeSymbol != Symbol .requiredClass(" java.lang.Object" )
155
155
case TypeSelect (Select (Ident (" _root_" ), " scala" ), " Product" ) => false
156
156
case TypeSelect (Select (Ident (" _root_" ), " scala" ), " Serializable" ) => false
157
157
case _ => true
@@ -357,7 +357,7 @@ class SourceCodePrinter[R <: Reflection & Singleton](val tasty: R)(syntaxHighlig
357
357
this += " throw "
358
358
printTree(expr)
359
359
360
- case Apply (fn, args) if fn.symbol == ctx .requiredMethod(" scala.internal.Quoted.exprQuote" ) =>
360
+ case Apply (fn, args) if fn.symbol == Symbol .requiredMethod(" scala.internal.Quoted.exprQuote" ) =>
361
361
args.head match {
362
362
case Block (stats, expr) =>
363
363
this += " '{"
@@ -372,12 +372,12 @@ class SourceCodePrinter[R <: Reflection & Singleton](val tasty: R)(syntaxHighlig
372
372
this += " }"
373
373
}
374
374
375
- case TypeApply (fn, args) if fn.symbol == ctx .requiredMethod(" scala.internal.Quoted.typeQuote" ) =>
375
+ case TypeApply (fn, args) if fn.symbol == Symbol .requiredMethod(" scala.internal.Quoted.typeQuote" ) =>
376
376
this += " '["
377
377
printTypeTree(args.head)
378
378
this += " ]"
379
379
380
- case Apply (fn, arg :: Nil ) if fn.symbol == ctx .requiredMethod(" scala.internal.Quoted.exprSplice" ) =>
380
+ case Apply (fn, arg :: Nil ) if fn.symbol == Symbol .requiredMethod(" scala.internal.Quoted.exprSplice" ) =>
381
381
this += " ${"
382
382
printTree(arg)
383
383
this += " }"
@@ -582,7 +582,7 @@ class SourceCodePrinter[R <: Reflection & Singleton](val tasty: R)(syntaxHighlig
582
582
def printFlatBlock (stats : List [Statement ], expr : Term )(using elideThis : Option [Symbol ]): Buffer = {
583
583
val (stats1, expr1) = flatBlock(stats, expr)
584
584
val stats2 = stats1.filter {
585
- case tree : TypeDef => ! tree.symbol.annots.exists(_.symbol.owner == ctx .requiredClass(" scala.internal.Quoted.quoteTypeTag" ))
585
+ case tree : TypeDef => ! tree.symbol.annots.exists(_.symbol.owner == Symbol .requiredClass(" scala.internal.Quoted.quoteTypeTag" ))
586
586
case _ => true
587
587
}
588
588
if (stats2.isEmpty) {
@@ -980,7 +980,7 @@ class SourceCodePrinter[R <: Reflection & Singleton](val tasty: R)(syntaxHighlig
980
980
printTypeAndAnnots(tp)
981
981
this += " "
982
982
printAnnotation(annot)
983
- case tpe : TypeRef if tpe.typeSymbol == ctx .requiredClass(" scala.runtime.Null$" ) || tpe.typeSymbol == ctx .requiredClass(" scala.runtime.Nothing$" ) =>
983
+ case tpe : TypeRef if tpe.typeSymbol == Symbol .requiredClass(" scala.runtime.Null$" ) || tpe.typeSymbol == Symbol .requiredClass(" scala.runtime.Nothing$" ) =>
984
984
// scala.runtime.Null$ and scala.runtime.Nothing$ are not modules, those are their actual names
985
985
printType(tpe)
986
986
case tpe : TermRef if tpe.termSymbol.isClassDef && tpe.termSymbol.name.endsWith(" $" ) =>
@@ -1023,7 +1023,7 @@ class SourceCodePrinter[R <: Reflection & Singleton](val tasty: R)(syntaxHighlig
1023
1023
case Annotated (tpt, annot) =>
1024
1024
val Annotation (ref, args) = annot
1025
1025
ref.tpe match {
1026
- case tpe : TypeRef if tpe.typeSymbol == ctx .requiredClass(" scala.annotation.internal.Repeated" ) =>
1026
+ case tpe : TypeRef if tpe.typeSymbol == Symbol .requiredClass(" scala.annotation.internal.Repeated" ) =>
1027
1027
val Types .Sequence (tp) = tpt.tpe
1028
1028
printType(tp)
1029
1029
this += highlightTypeDef(" *" )
@@ -1127,7 +1127,7 @@ class SourceCodePrinter[R <: Reflection & Singleton](val tasty: R)(syntaxHighlig
1127
1127
printType(tp)
1128
1128
this += " )"
1129
1129
inSquare(printTypesOrBounds(args, " , " ))
1130
- case tp : TypeRef if tp.typeSymbol == ctx .requiredClass(" scala.<repeated>" ) =>
1130
+ case tp : TypeRef if tp.typeSymbol == Symbol .requiredClass(" scala.<repeated>" ) =>
1131
1131
this += " _*"
1132
1132
case _ =>
1133
1133
printType(tp)
@@ -1240,7 +1240,7 @@ class SourceCodePrinter[R <: Reflection & Singleton](val tasty: R)(syntaxHighlig
1240
1240
1241
1241
def printAnnotation (annot : Term )(using elideThis : Option [Symbol ]): Buffer = {
1242
1242
val Annotation (ref, args) = annot
1243
- if (annot.symbol.maybeOwner == ctx .requiredClass(" scala.internal.quoted.showName" )) this
1243
+ if (annot.symbol.maybeOwner == Symbol .requiredClass(" scala.internal.quoted.showName" )) this
1244
1244
else {
1245
1245
this += " @"
1246
1246
printTypeTree(ref)
@@ -1255,8 +1255,8 @@ class SourceCodePrinter[R <: Reflection & Singleton](val tasty: R)(syntaxHighlig
1255
1255
val annots = definition.symbol.annots.filter {
1256
1256
case Annotation (annot, _) =>
1257
1257
val sym = annot.tpe.typeSymbol
1258
- sym != ctx .requiredClass(" scala.forceInline" ) &&
1259
- sym.maybeOwner != ctx .requiredPackage(" scala.annotation.internal" )
1258
+ sym != Symbol .requiredClass(" scala.forceInline" ) &&
1259
+ sym.maybeOwner != Symbol .requiredPackage(" scala.annotation.internal" )
1260
1260
case x => throw new MatchError (x.showExtractors)
1261
1261
}
1262
1262
printAnnotations(annots)
@@ -1416,7 +1416,7 @@ class SourceCodePrinter[R <: Reflection & Singleton](val tasty: R)(syntaxHighlig
1416
1416
private [this ] val namesIndex = collection.mutable.Map .empty[String , Int ]
1417
1417
1418
1418
private def splicedName (sym : Symbol )(using ctx : Context ): Option [String ] = {
1419
- sym.annots.find(_.symbol.owner == ctx .requiredClass(" scala.internal.quoted.showName" )).flatMap {
1419
+ sym.annots.find(_.symbol.owner == Symbol .requiredClass(" scala.internal.quoted.showName" )).flatMap {
1420
1420
case Apply (_, Literal (Constant (c : String )) :: Nil ) => Some (c)
1421
1421
case Apply (_, Inlined (_, _, Literal (Constant (c : String ))) :: Nil ) => Some (c)
1422
1422
case annot => None
@@ -1462,15 +1462,15 @@ class SourceCodePrinter[R <: Reflection & Singleton](val tasty: R)(syntaxHighlig
1462
1462
object Sequence {
1463
1463
def unapply (tpe : Type )(using ctx : Context ): Option [Type ] = tpe match {
1464
1464
case AppliedType (seq, (tp : Type ) :: Nil )
1465
- if seq.typeSymbol == ctx .requiredClass(" scala.collection.Seq" ) || seq.typeSymbol == ctx .requiredClass(" scala.collection.immutable.Seq" ) =>
1465
+ if seq.typeSymbol == Symbol .requiredClass(" scala.collection.Seq" ) || seq.typeSymbol == Symbol .requiredClass(" scala.collection.immutable.Seq" ) =>
1466
1466
Some (tp)
1467
1467
case _ => None
1468
1468
}
1469
1469
}
1470
1470
1471
1471
object Repeated {
1472
1472
def unapply (tpe : Type )(using ctx : Context ): Option [Type ] = tpe match {
1473
- case AppliedType (rep, (tp : Type ) :: Nil ) if rep.typeSymbol == ctx .requiredClass(" scala.<repeated>" ) => Some (tp)
1473
+ case AppliedType (rep, (tp : Type ) :: Nil ) if rep.typeSymbol == Symbol .requiredClass(" scala.<repeated>" ) => Some (tp)
1474
1474
case _ => None
1475
1475
}
1476
1476
}
0 commit comments