@@ -1115,7 +1115,7 @@ class SourceCodePrinter[R <: Reflection & Singleton](val tasty: R)(syntaxHighlig
1115
1115
tp match {
1116
1116
case tp : TypeLambda =>
1117
1117
printType(tpe.dealias)
1118
- case TypeRef ( Types . ScalaPackage (), " <repeated>" ) =>
1118
+ case tp : TypeRef if tp.typeSymbol == ctx.requiredClass( " scala. <repeated>" ) =>
1119
1119
this += " _*"
1120
1120
case _ =>
1121
1121
printType(tp)
@@ -1242,11 +1242,9 @@ class SourceCodePrinter[R <: Reflection & Singleton](val tasty: R)(syntaxHighlig
1242
1242
def printDefAnnotations (definition : Definition )(given elideThis : Option [Symbol ]): Buffer = {
1243
1243
val annots = definition.symbol.annots.filter {
1244
1244
case Annotation (annot, _) =>
1245
- annot.tpe match {
1246
- case tpe @ TypeRef if tpe.typeSymbol.maybeOwner == ctx.requiredPackage(" scala.annotation.internal" ) => false
1247
- case TypeRef (Types .ScalaPackage (), " forceInline" ) => false
1248
- case _ => true
1249
- }
1245
+ val sym = annot.tpe.typeSymbol
1246
+ sym != ctx.requiredClass(" scala.forceInline" ) &&
1247
+ sym.maybeOwner != ctx.requiredPackage(" scala.annotation.internal" )
1250
1248
case x => throw new MatchError (x.showExtractors)
1251
1249
}
1252
1250
printAnnotations(annots)
@@ -1443,18 +1441,11 @@ class SourceCodePrinter[R <: Reflection & Singleton](val tasty: R)(syntaxHighlig
1443
1441
1444
1442
object Repeated {
1445
1443
def unapply (tpe : Type )(given ctx : Context ): Option [Type ] = tpe match {
1446
- case AppliedType (TypeRef ( ScalaPackage (), " <repeated> " ), (tp : Type ) :: Nil ) => Some (tp)
1444
+ case AppliedType (rep, (tp : Type ) :: Nil ) if rep.typeSymbol == ctx.requiredClass( " scala.<repeated> " ) => Some (tp)
1447
1445
case _ => None
1448
1446
}
1449
1447
}
1450
1448
1451
- object ScalaPackage {
1452
- def unapply (tpe : TypeOrBounds )(given ctx : Context ): Boolean = tpe match {
1453
- case tpe : Type => tpe.termSymbol == defn.ScalaPackage
1454
- case _ => false
1455
- }
1456
- }
1457
-
1458
1449
}
1459
1450
1460
1451
object PackageObject {
0 commit comments