@@ -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. */
@@ -138,7 +138,7 @@ class SymUtils(val self: Symbol) extends AnyVal {
138
138
* entered at this point).
139
139
*/
140
140
def registerIfChild (late : Boolean = false )(implicit ctx : Context ): Unit = {
141
- def register (child : Symbol , parent : Type ) = {
141
+ def register (child : Symbol , parent : Type ): Unit = {
142
142
val cls = parent.classSymbol
143
143
if (cls.is(Sealed ) && (! late || child.isInaccessibleChildOf(cls)))
144
144
cls.addAnnotation(Annotation .Child (child))
@@ -156,7 +156,7 @@ class SymUtils(val self: Symbol) extends AnyVal {
156
156
* defined in a different toplevel class than its supposed parent class `cls`?
157
157
* Such children are not pickled, and have to be reconstituted manually.
158
158
*/
159
- def isInaccessibleChildOf (cls : Symbol )(implicit ctx : Context ) =
159
+ def isInaccessibleChildOf (cls : Symbol )(implicit ctx : Context ): Boolean =
160
160
self.isLocal && ! cls.topLevelClass.isLinkedWith(self.topLevelClass)
161
161
162
162
/** If this is a sealed class, its known children */
@@ -166,7 +166,7 @@ class SymUtils(val self: Symbol) extends AnyVal {
166
166
}
167
167
168
168
/** Is symbol directly or indirectly owned by a term symbol? */
169
- @ tailrec def isLocal (implicit ctx : Context ): Boolean = {
169
+ @ tailrec final def isLocal (implicit ctx : Context ): Boolean = {
170
170
val owner = self.owner
171
171
if (owner.isTerm) true
172
172
else if (owner.is(Package )) false
0 commit comments