Skip to content

Commit e7214a8

Browse files
committed
Add some commetns and improve code redability
1 parent f84d017 commit e7214a8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

library/src/scala/tasty/util/ShowSourceCode.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
114114

115115
def keepDefinition(d: Definition): Boolean = {
116116
val flags = d.flags
117-
import flags._
118-
def isCaseUnOverridableMethod: Boolean = {
117+
def isCaseClassUnOverridableMethod: Boolean = {
118+
// Currently the compiler does not allow overriding some of the methods generated for case classes
119119
d.flags.isSynthetic &&
120120
(d match {
121121
case DefDef("apply" | "unapply", _, _, _, _) if d.owner.flags.isObject => true
@@ -126,7 +126,7 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
126126
case _ => false
127127
})
128128
}
129-
!isParam && !isParamAccessor && !isCaseUnOverridableMethod
129+
!flags.isParam && !flags.isParamAccessor && !isCaseClassUnOverridableMethod
130130
}
131131
val stats1 = stats.collect {
132132
case stat@Definition() if keepDefinition(stat) => stat

0 commit comments

Comments
 (0)