@@ -72,7 +72,12 @@ class TastyPrinter[T <: Tasty with Singleton](val tasty: T) {
7272 case TypeDef (name, rhs) =>
7373 this += " TypeDef(" += name += " , " += rhs += " )"
7474 case ClassDef (name, constr, parents, self, body) =>
75- this += " ClassDef(" += name += " , " += constr += " , " ++= parents += " , " += self += " , " ++= body += " )"
75+ this += " ClassDef(" += name += " , " += constr += " , "
76+ visitList[Parent ](parents, {
77+ case parent @ Term () => this += parent
78+ case parent @ TypeTree () => this += parent
79+ })
80+ this += " , " += self += " , " ++= body += " )"
7681 case PackageDef (name, members) =>
7782 this += " PackageDef(" += name += " , " ++= members += " )"
7883 case Import (expr, selectors) =>
@@ -194,11 +199,6 @@ class TastyPrinter[T <: Tasty with Singleton](val tasty: T) {
194199 case Annotation (tree) => this += " Annotation(" += tree += " )"
195200 }
196201
197- def visitParent (x : Parent ): Buffer = x match {
198- case TermParent (term) => this += " TermParent(" += term += " )"
199- case TypeParent (typeTree) => this += " TypeParent(" += typeTree += " )"
200- }
201-
202202 def visitId (x : Id ): Buffer = {
203203 val Id (name) = x
204204 this += " Id(" += name += " )"
@@ -239,11 +239,6 @@ class TastyPrinter[T <: Tasty with Singleton](val tasty: T) {
239239 def ++= (x : List [CaseDef ]): Buffer = { visitList(x, visitCaseDef); buff }
240240 }
241241
242- private implicit class ParentOps (buff : Buffer ) {
243- def += (x : Parent ): Buffer = { visitParent(x); buff }
244- def ++= (x : List [Parent ]): Buffer = { visitList(x, visitParent); buff }
245- }
246-
247242 private implicit class PatternOps (buff : Buffer ) {
248243 def += (x : Pattern ): Buffer = { visitPattern(x); buff }
249244 def ++= (x : List [Pattern ]): Buffer = { visitList(x, visitPattern); buff }
0 commit comments