From bfb328ff64dcfa103c91dd0cd55a617e370d6ef3 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Wed, 27 Aug 2014 10:48:16 +0200 Subject: Make ThisTypes take TypeRefs instead of ClassSymbols This avoids stale symbol errors and does not need the somewhat unsystematic symbol rebinding of the last commit. --- src/dotty/tools/dotc/core/TypeOps.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/dotty/tools/dotc/core/TypeOps.scala') diff --git a/src/dotty/tools/dotc/core/TypeOps.scala b/src/dotty/tools/dotc/core/TypeOps.scala index f9ff42709..efd7fcca3 100644 --- a/src/dotty/tools/dotc/core/TypeOps.scala +++ b/src/dotty/tools/dotc/core/TypeOps.scala @@ -30,8 +30,8 @@ trait TypeOps { this: Context => val sym = tp.symbol if (sym.isStatic) tp else tp.derivedSelect(asSeenFrom(tp.prefix, pre, cls, theMap)) - case ThisType(thiscls) => - toPrefix(pre, cls, thiscls) + case tp: ThisType => + toPrefix(pre, cls, tp.cls) case _: BoundType | NoPrefix => tp case tp: RefinedType => @@ -224,7 +224,7 @@ trait TypeOps { this: Context => */ def forwardRef(argSym: Symbol, from: Symbol, to: TypeBounds, cls: ClassSymbol, decls: Scope) = argSym.info match { - case info @ TypeBounds(lo2 @ TypeRef(ThisType(_), name), hi2) => + case info @ TypeBounds(lo2 @ TypeRef(_: ThisType, name), hi2) => if (name == from.name && (lo2 eq hi2) && info.variance == to.variance && -- cgit v1.2.3