@@ -72,7 +72,7 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
7272 case tree @ PackageClause (name, stats) =>
7373 val stats1 = stats.collect {
7474 case IsPackageClause (stat) => stat
75- case IsDefinition (stat) if ! (stat.flags.isObject && stat.flags.isLazy) => stat
75+ case IsDefinition (stat) if ! (stat.symbol. flags.isObject && stat.symbol .flags.isLazy) => stat
7676 case stat @ Import (_, _) => stat
7777 }
7878 name match {
@@ -93,14 +93,14 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
9393 case IsClassDef (cdef @ ClassDef (name, DefDef (_, targs, argss, _, _), parents, self, stats)) =>
9494 printDefAnnotations(cdef)
9595
96- val flags = cdef.flags
96+ val flags = cdef.symbol. flags
9797 if (flags.isImplicit) this += " implicit "
9898 if (flags.isSealed) this += " sealed "
9999 if (flags.isFinal && ! flags.isObject) this += " final "
100100 if (flags.isCase) this += " case "
101101
102102 if (name == " package$" ) {
103- this += " package object " += cdef.owner.name.stripSuffix(" $" )
103+ this += " package object " += cdef.symbol. owner.name.stripSuffix(" $" )
104104 }
105105 else if (flags.isObject) this += " object " += name.stripSuffix(" $" )
106106 else if (flags.isTrait) this += " trait " += name
@@ -148,20 +148,20 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
148148 printSeparated(parents1)
149149
150150 def keepDefinition (d : Definition ): Boolean = {
151- val flags = d.flags
151+ val flags = d.symbol. flags
152152 def isCaseClassUnOverridableMethod : Boolean = {
153153 // Currently the compiler does not allow overriding some of the methods generated for case classes
154- d.flags.isSynthetic &&
154+ d.symbol. flags.isSynthetic &&
155155 (d match {
156- case DefDef (" apply" | " unapply" , _, _, _, _) if d.owner.flags.isObject => true
157- case DefDef (n, _, _, _, _) if d.owner.flags.isCase =>
156+ case DefDef (" apply" | " unapply" , _, _, _, _) if d.symbol. owner.flags.isObject => true
157+ case DefDef (n, _, _, _, _) if d.symbol. owner.flags.isCase =>
158158 n == " copy" ||
159159 n.matches(" copy\\ $default\\ $[1-9][0-9]*" ) || // default parameters for the copy method
160160 n.matches(" _[1-9][0-9]*" ) // Getters from Product
161161 case _ => false
162162 })
163163 }
164- def isInnerModuleObject = d.flags.isLazy && d.flags.isObject
164+ def isInnerModuleObject = d.symbol. flags.isLazy && d.symbol .flags.isObject
165165 ! flags.isParam && ! flags.isParamAccessor && ! flags.isFieldAccessor && ! isCaseClassUnOverridableMethod && ! isInnerModuleObject
166166 }
167167 val stats1 = stats.collect {
@@ -207,14 +207,14 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
207207 case IsValDef (vdef @ ValDef (name, tpt, rhs)) =>
208208 printDefAnnotations(vdef)
209209
210- val flags = vdef.flags
210+ val flags = vdef.symbol. flags
211211 if (flags.isImplicit) this += " implicit "
212212 if (flags.isOverride) this += " override "
213213
214214 printProtectedOrPrivate(vdef)
215215
216216 if (flags.isLazy) this += " lazy "
217- if (vdef.flags.isMutable) this += " var "
217+ if (vdef.symbol. flags.isMutable) this += " var "
218218 else this += " val "
219219
220220 this += name += " : "
@@ -242,7 +242,7 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
242242
243243 val isConstructor = name == " <init>"
244244
245- val flags = ddef.flags
245+ val flags = ddef.symbol. flags
246246 if (flags.isImplicit) this += " implicit "
247247 if (flags.isTransparent) this += " transparent "
248248 if (flags.isOverride) this += " override "
@@ -359,7 +359,7 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
359359
360360 case Term .Block (stats0, expr) =>
361361 val stats = stats0.filter {
362- case IsValDef (tree) => ! tree.flags.isObject
362+ case IsValDef (tree) => ! tree.symbol. flags.isObject
363363 case _ => true
364364 }
365365
@@ -589,8 +589,8 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
589589 args match {
590590 case Nil =>
591591 case arg :: _ =>
592- if (arg.flags.isErased) this += " erased "
593- if (arg.flags.isImplicit) this += " implicit "
592+ if (arg.symbol. flags.isErased) this += " erased "
593+ if (arg.symbol. flags.isImplicit) this += " implicit "
594594 }
595595
596596 def printSeparated (list : List [ValDef ]): Unit = list match {
@@ -620,20 +620,20 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
620620
621621 def printParamDef (arg : ValDef ): Unit = {
622622 val name = arg.name
623- arg.owner match {
624- case DefDef (" <init>" , _, _, _, _) =>
625- val ClassDef (_, _, _, _, body) = arg.owner.owner
623+ arg.symbol. owner.tree match {
624+ case Some ( DefDef (" <init>" , _, _, _, _) ) =>
625+ val Some ( ClassDef (_, _, _, _, body)) = arg.symbol. owner.owner.tree
626626 body.collectFirst {
627- case IsValDef (vdef @ ValDef (`name`, _, _)) if vdef.flags.isParamAccessor =>
628- if (! vdef.flags.isLocal) {
627+ case IsValDef (vdef @ ValDef (`name`, _, _)) if vdef.symbol. flags.isParamAccessor =>
628+ if (! vdef.symbol. flags.isLocal) {
629629 var printedPrefix = false
630- if (vdef.flags.isOverride) {
630+ if (vdef.symbol. flags.isOverride) {
631631 this += " override "
632632 printedPrefix = true
633633 }
634634 printedPrefix |= printProtectedOrPrivate(vdef)
635- if (vdef.flags.isMutable) this += " var "
636- else if (printedPrefix || ! vdef.flags.isCaseAcessor) this += " val "
635+ if (vdef.symbol. flags.isMutable) this += " var "
636+ else if (printedPrefix || ! vdef.symbol. flags.isCaseAcessor) this += " val "
637637 else this // val not explicitly needed
638638 }
639639 }
@@ -955,7 +955,7 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
955955 }
956956
957957 def printDefAnnotations (definition : Definition ): Buffer = {
958- val annots = definition.annots.filter {
958+ val annots = definition.symbol. annots.filter {
959959 case Annotation (annot, _) =>
960960 annot.tpe match {
961961 case Type .TypeRef (_, Type .SymRef (sym, _)) if sym.fullName == " scala.annotation.internal" => false
@@ -1059,16 +1059,16 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
10591059 this += sym.name
10601060 case _ => printFullClassName(within)
10611061 }
1062- if (definition.flags.isProtected) {
1062+ if (definition.symbol. flags.isProtected) {
10631063 this += " protected"
1064- definition.protectedWithin match {
1064+ definition.symbol. protectedWithin match {
10651065 case Some (within) =>
10661066 inSquare(printWithin(within))
10671067 case _ =>
10681068 }
10691069 prefixWasPrinted = true
10701070 } else {
1071- definition.privateWithin match {
1071+ definition.symbol. privateWithin match {
10721072 case Some (within) =>
10731073 this += " private"
10741074 inSquare(printWithin(within))
0 commit comments