aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Types.scala
diff options
context:
space:
mode:
authorDmitry Petrashko <dark@d-d.me>2014-07-23 09:59:27 +0200
committerDmitry Petrashko <dark@d-d.me>2014-07-23 09:59:27 +0200
commit2f298924940453ec0ed15afd36da8c66bd7e80d1 (patch)
tree64aba0165e77adf6bcf3b72ab39447b6670fda37 /src/dotty/tools/dotc/core/Types.scala
parent7fe148dac6deb8dcf556cc24be03992be81502e6 (diff)
parentdb2b4223a08fb5caa8b4fb774aa372b581ee7306 (diff)
downloaddotty-2f298924940453ec0ed15afd36da8c66bd7e80d1.tar.gz
dotty-2f298924940453ec0ed15afd36da8c66bd7e80d1.tar.bz2
dotty-2f298924940453ec0ed15afd36da8c66bd7e80d1.zip
Merge pull request #155 from dotty-staging/tailrecTC
Tailrec tc
Diffstat (limited to 'src/dotty/tools/dotc/core/Types.scala')
-rw-r--r--src/dotty/tools/dotc/core/Types.scala13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala
index 1d1c326a0..8149cce78 100644
--- a/src/dotty/tools/dotc/core/Types.scala
+++ b/src/dotty/tools/dotc/core/Types.scala
@@ -818,10 +818,17 @@ object Types {
}
}
-/* Not needed yet:
+ /** Same as `subst` but follows aliases as a fallback. When faced with a reference
+ * to an alias type, where normal substiution does not yield a new type, the
+ * substitution is instead applied to the alias. If that yields a new type,
+ * this type is returned, outherwise the original type (not the alias) is returned.
+ * A use case for this method is if one wants to substitute the type parameters
+ * of a class and also wants to substitute any parameter accessors that alias
+ * the type parameters.
+ */
final def substDealias(from: List[Symbol], to: List[Type])(implicit ctx: Context): Type =
- new ctx.SubstDealiasMap(from, to).apply(this)
-*/
+ ctx.substDealias(this, from, to, null)
+
/** Substitute all types of the form `PolyParam(from, N)` by
* `PolyParam(to, N)`.
*/