aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/TypeOps.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools/dotc/core/TypeOps.scala')
-rw-r--r--src/dotty/tools/dotc/core/TypeOps.scala9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/core/TypeOps.scala b/src/dotty/tools/dotc/core/TypeOps.scala
index 6e984e43c..afa39f2a3 100644
--- a/src/dotty/tools/dotc/core/TypeOps.scala
+++ b/src/dotty/tools/dotc/core/TypeOps.scala
@@ -50,8 +50,11 @@ trait TypeOps { this: Context =>
/** Implementation of Types#simplified */
final def simplify(tp: Type, theMap: SimplifyMap): Type = tp match {
case tp: NamedType =>
- tp.derivedSelect(simplify(tp.prefix, theMap))
- case _: ThisType | NoPrefix =>
+ if (tp.symbol.isStatic) tp
+ else tp.derivedSelect(simplify(tp.prefix, theMap))
+ case tp: PolyParam =>
+ typerState.constraint.typeVarOfParam(tp) orElse tp
+ case _: ThisType | _: BoundType | NoPrefix =>
tp
case tp: RefinedType =>
tp.derivedRefinedType(simplify(tp.parent, theMap), tp.refinedName, simplify(tp.refinedInfo, theMap))
@@ -59,8 +62,6 @@ trait TypeOps { this: Context =>
simplify(l, theMap) & simplify(r, theMap)
case OrType(l, r) =>
simplify(l, theMap) | simplify(r, theMap)
- case tp: PolyParam =>
- typerState.constraint.typeVarOfParam(tp) orElse tp
case _ =>
(if (theMap != null) theMap else new SimplifyMap).mapOver(tp)
}