@@ -9,19 +9,19 @@ class SourceCodePrinter[R <: Reflection & Singleton](val tasty: R)(syntaxHighlig
9
9
import tasty ._
10
10
import syntaxHighlight ._
11
11
12
- def showTree (tree : Tree )( using ctx : Context ) : String =
12
+ def showTree (tree : Tree ): String =
13
13
(new Buffer ).printTree(tree).result()
14
14
15
- def showTypeOrBounds (tpe : TypeOrBounds )( using ctx : Context ) : String =
15
+ def showTypeOrBounds (tpe : TypeOrBounds ): String =
16
16
(new Buffer ).printTypeOrBound(tpe)(using None ).result()
17
17
18
- def showConstant (const : Constant )( using ctx : Context ) : String =
18
+ def showConstant (const : Constant ): String =
19
19
(new Buffer ).printConstant(const).result()
20
20
21
- def showSymbol (symbol : Symbol )( using ctx : Context ) : String =
21
+ def showSymbol (symbol : Symbol ): String =
22
22
symbol.fullName
23
23
24
- def showFlags (flags : Flags )( using ctx : Context ) : String = {
24
+ def showFlags (flags : Flags ): String = {
25
25
val flagList = List .newBuilder[String ]
26
26
if (flags.is(Flags .Abstract )) flagList += " abstract"
27
27
if (flags.is(Flags .Artifact )) flagList += " artifact"
@@ -60,7 +60,7 @@ class SourceCodePrinter[R <: Reflection & Singleton](val tasty: R)(syntaxHighlig
60
60
flagList.result().mkString(" /*" , " " , " */" )
61
61
}
62
62
63
- private class Buffer ( using ctx : Context ) {
63
+ private class Buffer {
64
64
65
65
private [this ] val sb : StringBuilder = new StringBuilder
66
66
@@ -1416,7 +1416,7 @@ class SourceCodePrinter[R <: Reflection & Singleton](val tasty: R)(syntaxHighlig
1416
1416
private [this ] val names = collection.mutable.Map .empty[Symbol , String ]
1417
1417
private [this ] val namesIndex = collection.mutable.Map .empty[String , Int ]
1418
1418
1419
- private def splicedName (sym : Symbol )( using ctx : Context ) : Option [String ] = {
1419
+ private def splicedName (sym : Symbol ): Option [String ] = {
1420
1420
sym.annots.find(_.symbol.owner == Symbol .requiredClass(" scala.internal.quoted.showName" )).flatMap {
1421
1421
case Apply (_, Literal (Constant (c : String )) :: Nil ) => Some (c)
1422
1422
case Apply (_, Inlined (_, _, Literal (Constant (c : String ))) :: Nil ) => Some (c)
@@ -1437,7 +1437,7 @@ class SourceCodePrinter[R <: Reflection & Singleton](val tasty: R)(syntaxHighlig
1437
1437
}
1438
1438
1439
1439
private object SpecialOp {
1440
- def unapply (arg : Tree )( using ctx : Context ) : Option [(String , List [Term ])] = arg match {
1440
+ def unapply (arg : Tree ): Option [(String , List [Term ])] = arg match {
1441
1441
case arg @ Apply (fn, args) =>
1442
1442
fn.tpe match {
1443
1443
case tpe @ TermRef (ThisType (TypeRef (_, name)), name2) if name == " <special-ops>" =>
@@ -1449,7 +1449,7 @@ class SourceCodePrinter[R <: Reflection & Singleton](val tasty: R)(syntaxHighlig
1449
1449
}
1450
1450
1451
1451
private object Annotation {
1452
- def unapply (arg : Tree )( using ctx : Context ) : Option [(TypeTree , List [Term ])] = arg match {
1452
+ def unapply (arg : Tree ): Option [(TypeTree , List [Term ])] = arg match {
1453
1453
case New (annot) => Some ((annot, Nil ))
1454
1454
case Apply (Select (New (annot), " <init>" ), args) => Some ((annot, args))
1455
1455
case Apply (TypeApply (Select (New (annot), " <init>" ), targs), args) => Some ((annot, args))
@@ -1461,7 +1461,7 @@ class SourceCodePrinter[R <: Reflection & Singleton](val tasty: R)(syntaxHighlig
1461
1461
private object Types {
1462
1462
1463
1463
object Sequence {
1464
- def unapply (tpe : Type )( using ctx : Context ) : Option [Type ] = tpe match {
1464
+ def unapply (tpe : Type ): Option [Type ] = tpe match {
1465
1465
case AppliedType (seq, (tp : Type ) :: Nil )
1466
1466
if seq.typeSymbol == Symbol .requiredClass(" scala.collection.Seq" ) || seq.typeSymbol == Symbol .requiredClass(" scala.collection.immutable.Seq" ) =>
1467
1467
Some (tp)
@@ -1470,7 +1470,7 @@ class SourceCodePrinter[R <: Reflection & Singleton](val tasty: R)(syntaxHighlig
1470
1470
}
1471
1471
1472
1472
object Repeated {
1473
- def unapply (tpe : Type )( using ctx : Context ) : Option [Type ] = tpe match {
1473
+ def unapply (tpe : Type ): Option [Type ] = tpe match {
1474
1474
case AppliedType (rep, (tp : Type ) :: Nil ) if rep.typeSymbol == Symbol .requiredClass(" scala.<repeated>" ) => Some (tp)
1475
1475
case _ => None
1476
1476
}
@@ -1479,7 +1479,7 @@ class SourceCodePrinter[R <: Reflection & Singleton](val tasty: R)(syntaxHighlig
1479
1479
}
1480
1480
1481
1481
object PackageObject {
1482
- def unapply (tree : Tree )( using ctx : Context ) : Option [Tree ] = tree match {
1482
+ def unapply (tree : Tree ): Option [Tree ] = tree match {
1483
1483
case PackageClause (_, ValDef (" package" , _, _) :: body :: Nil ) => Some (body)
1484
1484
case _ => None
1485
1485
}
0 commit comments