File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed
src/dotty/tools/dotc/transform Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -30,15 +30,24 @@ class SymUtils(val self: Symbol) extends AnyVal {
30
30
else parents.head.symbol
31
31
}
32
32
33
+
34
+ /**
35
+ * For a class: All interfaces implemented by a class except for those inherited through the superclass.
36
+ * For a trait: all parent traits
37
+ */
38
+
39
+ def superInterfaces (implicit ctx : Context ) = {
40
+ val superCls = self.superClass
41
+ val baseClasses = self.asClass.baseClasses
42
+ if (baseClasses.isEmpty) Nil
43
+ else baseClasses.tail.takeWhile(_ ne superCls).reverse
44
+
45
+ }
46
+
33
47
/** All interfaces implemented by a class, except for those inherited through the superclass. */
34
48
def mixins (implicit ctx : Context ) = {
35
- val superCls = self.superClass
36
49
if (self is Trait ) Nil
37
- else {
38
- val baseClasses = self.asClass.baseClasses
39
- if (baseClasses.isEmpty) Nil
40
- else baseClasses.tail.takeWhile(_ ne superCls).reverse
41
- }
50
+ else superInterfaces
42
51
}
43
52
44
53
def isTypeTestOrCast (implicit ctx : Context ): Boolean =
You can’t perform that action at this time.
0 commit comments