aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/TypeComparer.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools/dotc/core/TypeComparer.scala')
-rw-r--r--src/dotty/tools/dotc/core/TypeComparer.scala6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/core/TypeComparer.scala b/src/dotty/tools/dotc/core/TypeComparer.scala
index 88f563cb9..b1081e433 100644
--- a/src/dotty/tools/dotc/core/TypeComparer.scala
+++ b/src/dotty/tools/dotc/core/TypeComparer.scala
@@ -79,12 +79,11 @@ class TypeComparer(initctx: Context) extends DotClass {
* otherwise it is approximated by its upper bound. However, any occurrences
* of the parameter in a refinement somewhere in the bound are removed.
* (Such occurrences can arise for F-bounded types).
- * The type parameter is removed from the constraint's domain and all its
- * occurrences are replaced by its approximation.
+ * The constraint is left unchanged.
* @return the instantiating type
* @pre `param` is associated with type bounds in the current constraint.
*/
- def approximate(param: PolyParam, fromBelow: Boolean): Type = {
+ def approximation(param: PolyParam, fromBelow: Boolean): Type = {
val avoidParam = new TypeMap {
override def apply(tp: Type) = mapOver {
tp match {
@@ -97,7 +96,6 @@ class TypeComparer(initctx: Context) extends DotClass {
val bound = if (fromBelow) bounds.lo else bounds.hi
val inst = avoidParam(bound)
println(s"approx ${param.show}, from below = $fromBelow, bound = ${bound.show}, inst = ${inst.show}")
- constraint = constraint.replace(param, inst)
inst
}