diff options
Diffstat (limited to 'src/dotty/tools/dotc/core')
-rw-r--r-- | src/dotty/tools/dotc/core/Flags.scala | 3 | ||||
-rw-r--r-- | src/dotty/tools/dotc/core/Types.scala | 9 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/core/Flags.scala b/src/dotty/tools/dotc/core/Flags.scala index 02b341649..d1f562f72 100644 --- a/src/dotty/tools/dotc/core/Flags.scala +++ b/src/dotty/tools/dotc/core/Flags.scala @@ -543,6 +543,9 @@ object Flags { /** A lazy or deferred value */ final val LazyOrDeferred = Lazy | Deferred + /** A synthetic or private definition */ + final val SyntheticOrPrivate = Synthetic | Private + /** A type parameter or type parameter accessor */ final val TypeParamOrAccessor = TypeParam | TypeParamAccessor diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index 8595da640..16287c827 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -1014,6 +1014,12 @@ object Types { case _ => List() } + /** The full parent types, including all type arguments */ + def parentsWithArgs(implicit ctx: Context): List[Type] = this match { + case tp: TypeProxy => tp.underlying.parents + case _ => List() + } + /** The first parent of this type, AnyRef if list of parents is empty */ def firstParent(implicit ctx: Context): TypeRef = parents match { case p :: _ => p @@ -2780,6 +2786,9 @@ object Types { parentsCache } + override def parentsWithArgs(implicit ctx: Context): List[Type] = + parents.map(p => typeRef.baseTypeWithArgs(p.symbol)) + /** The parent types with all type arguments */ def instantiatedParents(implicit ctx: Context): List[Type] = parents mapConserve { pref => |