aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Substituters.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools/dotc/core/Substituters.scala')
-rw-r--r--src/dotty/tools/dotc/core/Substituters.scala9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/core/Substituters.scala b/src/dotty/tools/dotc/core/Substituters.scala
index 205188507..119aca569 100644
--- a/src/dotty/tools/dotc/core/Substituters.scala
+++ b/src/dotty/tools/dotc/core/Substituters.scala
@@ -181,8 +181,13 @@ trait Substituters { this: Context =>
final def substThis(tp: Type, from: RefinedType, to: Type, theMap: SubstRefinedThisMap): Type =
tp match {
- case tp @ RefinedThis(rt, _) =>
- if (rt eq from) to else tp
+ case tp @ RefinedThis(rt, level) =>
+ if (rt eq from)
+ to match { // !!! TODO drop
+ case RefinedThis(rt1, -1) => RefinedThis(rt1, level)
+ case _ => to
+ }
+ else tp
case tp: NamedType =>
if (tp.currentSymbol.isStatic) tp
else tp.derivedSelect(substThis(tp.prefix, from, to, theMap))