@@ -29,7 +29,7 @@ class SymUtils(val self: Symbol) extends AnyVal {
29
29
import SymUtils ._
30
30
31
31
/** All traits implemented by a class or trait except for those inherited through the superclass. */
32
- def directlyInheritedTraits (implicit ctx : Context ) = {
32
+ def directlyInheritedTraits (implicit ctx : Context ): List [ ClassSymbol ] = {
33
33
val superCls = self.asClass.superClass
34
34
val baseClasses = self.asClass.baseClasses
35
35
if (baseClasses.isEmpty) Nil
@@ -39,7 +39,7 @@ class SymUtils(val self: Symbol) extends AnyVal {
39
39
/** All traits implemented by a class, except for those inherited through the superclass.
40
40
* The empty list if `self` is a trait.
41
41
*/
42
- def mixins (implicit ctx : Context ) = {
42
+ def mixins (implicit ctx : Context ): List [ ClassSymbol ] = {
43
43
if (self is Trait ) Nil
44
44
else directlyInheritedTraits
45
45
}
@@ -50,15 +50,15 @@ class SymUtils(val self: Symbol) extends AnyVal {
50
50
def isTypeTestOrCast (implicit ctx : Context ): Boolean =
51
51
self == defn.Any_asInstanceOf || isTypeTest
52
52
53
- def isVolatile (implicit ctx : Context ) = self.hasAnnotation(defn.VolatileAnnot )
53
+ def isVolatile (implicit ctx : Context ): Boolean = self.hasAnnotation(defn.VolatileAnnot )
54
54
55
- def isAnyOverride (implicit ctx : Context ) = self.is(Override ) || self.is(AbsOverride )
55
+ def isAnyOverride (implicit ctx : Context ): Boolean = self.is(Override ) || self.is(AbsOverride )
56
56
// careful: AbsOverride is a term only flag. combining with Override would catch only terms.
57
57
58
- def isSuperAccessor (implicit ctx : Context ) = self.name.is(SuperAccessorName )
58
+ def isSuperAccessor (implicit ctx : Context ): Boolean = self.name.is(SuperAccessorName )
59
59
60
60
/** A type or term parameter or a term parameter accessor */
61
- def isParamOrAccessor (implicit ctx : Context ) =
61
+ def isParamOrAccessor (implicit ctx : Context ): Boolean =
62
62
self.is(Param ) || self.is(ParamAccessor )
63
63
64
64
/** If this is a constructor, its owner: otherwise this. */
@@ -88,9 +88,6 @@ class SymUtils(val self: Symbol) extends AnyVal {
88
88
def accessorNamed (name : TermName )(implicit ctx : Context ): Symbol =
89
89
self.owner.info.decl(name).suchThat(_ is Accessor ).symbol
90
90
91
- def paramAccessors (implicit ctx : Context ): List [Symbol ] =
92
- self.info.decls.filter(_ is ParamAccessor )
93
-
94
91
def caseAccessors (implicit ctx : Context ): List [Symbol ] =
95
92
self.info.decls.filter(_ is CaseAccessor )
96
93
@@ -159,7 +156,7 @@ class SymUtils(val self: Symbol) extends AnyVal {
159
156
* defined in a different toplevel class than its supposed parent class `cls`?
160
157
* Such children are not pickled, and have to be reconstituted manually.
161
158
*/
162
- def isInaccessibleChildOf (cls : Symbol )(implicit ctx : Context ) =
159
+ def isInaccessibleChildOf (cls : Symbol )(implicit ctx : Context ): Boolean =
163
160
self.isLocal && ! cls.topLevelClass.isLinkedWith(self.topLevelClass)
164
161
165
162
/** If this is a sealed class, its known children */
@@ -169,7 +166,7 @@ class SymUtils(val self: Symbol) extends AnyVal {
169
166
}
170
167
171
168
/** Is symbol directly or indirectly owned by a term symbol? */
172
- @ tailrec def isLocal (implicit ctx : Context ): Boolean = {
169
+ @ tailrec final def isLocal (implicit ctx : Context ): Boolean = {
173
170
val owner = self.owner
174
171
if (owner.isTerm) true
175
172
else if (owner.is(Package )) false
0 commit comments