@@ -743,10 +743,10 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
743
743
printTypeAndAnnots(tp)
744
744
this += " "
745
745
printAnnotation(annot)
746
- case Type .SymRef (sym, _) if sym.symbol. isClass && (sym.symbol. fullName == " scala.runtime.Null$" || sym.symbol .fullName == " scala.runtime.Nothing$" ) =>
746
+ case Type .SymRef (sym, _) if sym.isClass && (sym.fullName == " scala.runtime.Null$" || sym.fullName == " scala.runtime.Nothing$" ) =>
747
747
// scala.runtime.Null$ and scala.runtime.Nothing$ are not modules, those are their actual names
748
748
printType(tpe)
749
- case tpe @ Type .SymRef (sym, _) if sym.symbol. isClass && sym.name.endsWith(" $" ) =>
749
+ case tpe @ Type .SymRef (sym, _) if sym.isClass && sym.name.endsWith(" $" ) =>
750
750
printType(tpe)
751
751
this += " .type"
752
752
case tpe => printType(tpe)
@@ -826,7 +826,7 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
826
826
case Type .SymRef (sym, prefix) =>
827
827
prefix match {
828
828
case Types .EmptyPrefix () =>
829
- case IsType (prefix @ Type .SymRef (sym, _)) if sym.symbol. isClass =>
829
+ case IsType (prefix @ Type .SymRef (sym, _)) if sym.isClass =>
830
830
printType(prefix)
831
831
this += " #"
832
832
case IsType (prefix) =>
@@ -958,7 +958,7 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
958
958
val annots = definition.annots.filter {
959
959
case Annotation (annot, _) =>
960
960
annot.tpe match {
961
- case Type .TypeRef (_, Type .SymRef (sym, _)) if sym.symbol. fullName == " scala.annotation.internal" => false
961
+ case Type .TypeRef (_, Type .SymRef (sym, _)) if sym.fullName == " scala.annotation.internal" => false
962
962
case Type .TypeRef (" forceInline" , Types .ScalaPackage ()) => false
963
963
case _ => true
964
964
}
@@ -1055,7 +1055,7 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
1055
1055
def printProtectedOrPrivate (definition : Definition ): Boolean = {
1056
1056
var prefixWasPrinted = false
1057
1057
def printWithin (within : Type ) = within match {
1058
- case Type .SymRef (sym @ PackageDef (name, _) , _) =>
1058
+ case Type .SymRef (sym, _) =>
1059
1059
this += sym.name
1060
1060
case _ => printFullClassName(within)
1061
1061
}
@@ -1083,7 +1083,7 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
1083
1083
1084
1084
def printFullClassName (tp : TypeOrBounds ): Unit = {
1085
1085
def printClassPrefix (prefix : TypeOrBounds ): Unit = prefix match {
1086
- case Type .SymRef (sym, prefix2) if sym.symbol. isClass =>
1086
+ case Type .SymRef (sym, prefix2) if sym.isClass =>
1087
1087
printClassPrefix(prefix2)
1088
1088
this += sym.name += " ."
1089
1089
case _ =>
@@ -1122,8 +1122,11 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
1122
1122
def unapply (arg : Tree )(implicit ctx : Context ): Option [(String , List [Term ])] = arg match {
1123
1123
case IsTerm (arg @ Term .Apply (fn, args)) =>
1124
1124
fn.tpe match {
1125
- case Type .SymRef (DefDef (op, _, _, _, _), Type .ThisType (Type .SymRef (sym2, _))) if sym2.name == " <special-ops>" =>
1126
- Some ((op, args))
1125
+ case Type .SymRef (sym, Type .ThisType (Type .SymRef (sym2, _))) if sym2.name == " <special-ops>" =>
1126
+ sym.tree match {
1127
+ case Some (DefDef (op, _, _, _, _)) => Some ((op, args))
1128
+ case _ => None
1129
+ }
1127
1130
case _ => None
1128
1131
}
1129
1132
case _ => None
@@ -1144,7 +1147,7 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
1144
1147
1145
1148
object JavaLangObject {
1146
1149
def unapply (tpe : Type )(implicit ctx : Context ): Boolean = tpe match {
1147
- case Type .TypeRef (" Object" , Type .SymRef (sym, _)) if sym.symbol. fullName == " java.lang" => true
1150
+ case Type .TypeRef (" Object" , Type .SymRef (sym, _)) if sym.fullName == " java.lang" => true
1148
1151
case _ => false
1149
1152
}
1150
1153
}
@@ -1158,21 +1161,21 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
1158
1161
1159
1162
object ScalaPackage {
1160
1163
def unapply (tpe : TypeOrBounds )(implicit ctx : Context ): Boolean = tpe match {
1161
- case Type .SymRef (sym, _) => sym.symbol == definitions.ScalaPackage
1164
+ case Type .SymRef (sym, _) => sym == definitions.ScalaPackage
1162
1165
case _ => false
1163
1166
}
1164
1167
}
1165
1168
1166
1169
object RootPackage {
1167
1170
def unapply (tpe : TypeOrBounds )(implicit ctx : Context ): Boolean = tpe match {
1168
- case Type .SymRef (sym, _) => sym.symbol == definitions.RootClass
1171
+ case Type .SymRef (sym, _) => sym == definitions.RootClass
1169
1172
case _ => false
1170
1173
}
1171
1174
}
1172
1175
1173
1176
object EmptyPackage {
1174
1177
def unapply (tpe : TypeOrBounds )(implicit ctx : Context ): Boolean = tpe match {
1175
- case Type .SymRef (sym, _) => sym.symbol == definitions.EmptyPackageClass
1178
+ case Type .SymRef (sym, _) => sym == definitions.EmptyPackageClass
1176
1179
case _ => false
1177
1180
}
1178
1181
}
0 commit comments