@@ -344,7 +344,13 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
344
344
case Term .Typed (term, tpt) =>
345
345
tpt.tpe match {
346
346
case Types .Repeated (_) =>
347
- printTree(term)
347
+ term match {
348
+ case Term .Repeated (_) =>
349
+ printTree(term)
350
+ case _ =>
351
+ printTree(term)
352
+ this += " : " += highlightTypeDef(" _*" , color)
353
+ }
348
354
case _ =>
349
355
inParens {
350
356
printTree(term)
@@ -790,9 +796,16 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
790
796
791
797
case TypeTree .Annotated (tpt, annot) =>
792
798
val Annotation (ref, args) = annot
793
- printTypeTree(tpt)
794
- this += " "
795
- printAnnotation(annot)
799
+ ref.tpe match {
800
+ case Types .RepeatedAnnotation () =>
801
+ val Types .Sequence (tp) = tpt.tpe
802
+ printType(tp)
803
+ this += highlightTypeDef(" *" , color)
804
+ case _ =>
805
+ printTypeTree(tpt)
806
+ this += " "
807
+ printAnnotation(annot)
808
+ }
796
809
797
810
case TypeTree .And (left, right) =>
798
811
printTypeTree(left)
@@ -1160,6 +1173,20 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
1160
1173
}
1161
1174
}
1162
1175
1176
+ object Sequence {
1177
+ def unapply (tpe : Type )(implicit ctx : Context ): Option [Type ] = tpe match {
1178
+ case Type .AppliedType (Type .TypeRef (" Seq" , Type .SymRef (sym, _)), IsType (tp) :: Nil ) if sym.fullName == " scala.collection" => Some (tp)
1179
+ case _ => None
1180
+ }
1181
+ }
1182
+
1183
+ object RepeatedAnnotation {
1184
+ def unapply (tpe : Type )(implicit ctx : Context ): Boolean = tpe match {
1185
+ case Type .TypeRef (" Repeated" , Type .SymRef (sym, _)) if sym.fullName == " scala.annotation.internal" => true
1186
+ case _ => false
1187
+ }
1188
+ }
1189
+
1163
1190
object Repeated {
1164
1191
def unapply (tpe : Type )(implicit ctx : Context ): Option [Type ] = tpe match {
1165
1192
case Type .AppliedType (Type .TypeRef (" <repeated>" , ScalaPackage ()), IsType (tp) :: Nil ) => Some (tp)
0 commit comments