@@ -150,7 +150,7 @@ class SourceCodePrinter[R <: Reflection & Singleton](val tasty: R)(syntaxHighlig
150
150
}
151
151
152
152
val parents1 = parents.filter {
153
- case Apply (Select (New (tpt), _), _) => ! Types . JavaLangObject .unapply(tpt.tpe )
153
+ case Apply (Select (New (tpt), _), _) => tpt.tpe.typeSymbol != ctx.requiredClass( " java.lang.Object " )
154
154
case TypeSelect (Select (Ident (" _root_" ), " scala" ), " Product" ) => false
155
155
case TypeSelect (Select (Ident (" _root_" ), " scala" ), " Serializable" ) => false
156
156
case _ => true
@@ -1014,7 +1014,7 @@ class SourceCodePrinter[R <: Reflection & Singleton](val tasty: R)(syntaxHighlig
1014
1014
case Annotated (tpt, annot) =>
1015
1015
val Annotation (ref, args) = annot
1016
1016
ref.tpe match {
1017
- case Types . RepeatedAnnotation ( ) =>
1017
+ case tpe : TypeRef if tpe.typeSymbol == ctx.requiredClass( " scala.annotation.internal.Repeated " ) =>
1018
1018
val Types .Sequence (tp) = tpt.tpe
1019
1019
printType(tp)
1020
1020
this += highlightTypeDef(" *" )
@@ -1434,27 +1434,13 @@ class SourceCodePrinter[R <: Reflection & Singleton](val tasty: R)(syntaxHighlig
1434
1434
// TODO Provide some of these in scala.tasty.Reflection.scala and implement them using checks on symbols for performance
1435
1435
private object Types {
1436
1436
1437
- object JavaLangObject {
1438
- def unapply (tpe : Type )(given ctx : Context ): Boolean = tpe match {
1439
- case TypeRef (prefix : TermRef , " Object" ) => prefix.typeSymbol == ctx.requiredPackage(" java.lang" )
1440
- case _ => false
1441
- }
1442
- }
1443
-
1444
1437
object Sequence {
1445
1438
def unapply (tpe : Type )(given ctx : Context ): Option [Type ] = tpe match {
1446
1439
case AppliedType (seq, (tp : Type ) :: Nil ) if seq.typeSymbol == ctx.requiredClass(" scala.collection.Seq" ) => Some (tp)
1447
1440
case _ => None
1448
1441
}
1449
1442
}
1450
1443
1451
- object RepeatedAnnotation {
1452
- def unapply (tpe : Type )(given ctx : Context ): Boolean = tpe match {
1453
- case tpe : TypeRef => tpe.typeSymbol == ctx.requiredClass(" scala.annotation.internal.Repeated" )
1454
- case _ => false
1455
- }
1456
- }
1457
-
1458
1444
object Repeated {
1459
1445
def unapply (tpe : Type )(given ctx : Context ): Option [Type ] = tpe match {
1460
1446
case AppliedType (TypeRef (ScalaPackage (), " <repeated>" ), (tp : Type ) :: Nil ) => Some (tp)
0 commit comments