aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Types.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-02-08 14:35:53 +0100
committerMartin Odersky <odersky@gmail.com>2016-02-19 16:57:35 +0100
commitfc043bfb2e1c8fd0a73b87a4c955e3e09f6bf8c0 (patch)
tree1f2813884bfcd8fff4e558f6a61aa40b750b613e /src/dotty/tools/dotc/core/Types.scala
parenteb1908a9f2c61895cabe70c0ac0ebbe8ef14fcea (diff)
downloaddotty-fc043bfb2e1c8fd0a73b87a4c955e3e09f6bf8c0.tar.gz
dotty-fc043bfb2e1c8fd0a73b87a4c955e3e09f6bf8c0.tar.bz2
dotty-fc043bfb2e1c8fd0a73b87a4c955e3e09f6bf8c0.zip
Add checking for leaking private definitions
First version. Fixes #997.
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 =>