aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/TypeOps.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-04-04 09:57:15 +0200
committerMartin Odersky <odersky@gmail.com>2013-04-04 09:57:15 +0200
commit9cd15421432871b920d377af86e1cd1b3edb270e (patch)
tree89906915175582a84d44dc56a8df2b2b65539ed9 /src/dotty/tools/dotc/core/TypeOps.scala
parent609aeee025eec0bfc6680bf7fe717d0083cfb15b (diff)
downloaddotty-9cd15421432871b920d377af86e1cd1b3edb270e.tar.gz
dotty-9cd15421432871b920d377af86e1cd1b3edb270e.tar.bz2
dotty-9cd15421432871b920d377af86e1cd1b3edb270e.zip
Trying to get at the root of cyclic reference problems.
Part 1: Enabling tracing and avoiding subtype computations in margeDenot.
Diffstat (limited to 'src/dotty/tools/dotc/core/TypeOps.scala')
-rw-r--r--src/dotty/tools/dotc/core/TypeOps.scala42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/dotty/tools/dotc/core/TypeOps.scala b/src/dotty/tools/dotc/core/TypeOps.scala
index f86cc5296..7b09df769 100644
--- a/src/dotty/tools/dotc/core/TypeOps.scala
+++ b/src/dotty/tools/dotc/core/TypeOps.scala
@@ -19,32 +19,32 @@ trait TypeOps { this: Context =>
else
toPrefix(pre.baseType(cls).normalizedPrefix, cls.owner, thiscls)
- /* !!! DEBUG ctx.traceIndented(s"$tp.asSeenFrom($pre, $cls)") */ {
- tp match {
- case tp: NamedType =>
- val sym = tp.symbol
- if (sym.isStatic) tp
- else {
- val tp1 = tp.derivedNamedType(asSeenFrom(tp.prefix, pre, cls, theMap))
- // short-circuit instantiated type parameters
- if ((tp1 ne tp) && (sym is (TypeParam, butNot = Deferred))) tp1.dealias
- else tp1
- }
- case ThisType(thiscls) =>
- toPrefix(pre, cls, thiscls)
- case _: BoundType | NoPrefix =>
- tp
- case tp: RefinedType =>
- tp.derivedRefinedType(
+ ctx.traceIndented(s"$tp.asSeenFrom($pre, $cls)") {
+ tp match {
+ case tp: NamedType =>
+ val sym = tp.symbol
+ if (sym.isStatic) tp
+ else {
+ val tp1 = tp.derivedNamedType(asSeenFrom(tp.prefix, pre, cls, theMap))
+ // short-circuit instantiated type parameters
+ if ((tp1 ne tp) && (sym is (TypeParam, butNot = Deferred))) tp1.dealias
+ else tp1
+ }
+ case ThisType(thiscls) =>
+ toPrefix(pre, cls, thiscls)
+ case _: BoundType | NoPrefix =>
+ tp
+ case tp: RefinedType =>
+ tp.derivedRefinedType(
asSeenFrom(tp.parent, pre, cls, theMap),
tp.refinedName,
asSeenFrom(tp.refinedInfo, pre, cls, theMap))
- case _ =>
- (if (theMap != null) theMap else new AsSeenFromMap(pre, cls))
- .mapOver(tp)
+ case _ =>
+ (if (theMap != null) theMap else new AsSeenFromMap(pre, cls))
+ .mapOver(tp)
+ }
}
}
- }
class AsSeenFromMap(pre: Type, cls: Symbol) extends TypeMap {
def apply(tp: Type) = asSeenFrom(tp, pre, cls, this)