aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Types.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools/dotc/core/Types.scala')
-rw-r--r--src/dotty/tools/dotc/core/Types.scala9
1 files changed, 9 insertions, 0 deletions
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 =>