aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Inferencing.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-02-20 10:43:54 +0100
committerMartin Odersky <odersky@gmail.com>2014-02-21 18:42:50 +0100
commitd8f1fa55af2d832c07d89abaf9ecffc44c6572f8 (patch)
treeb5eca43019c12d9e1845c7ddaec65bc9d8289ff0 /src/dotty/tools/dotc/typer/Inferencing.scala
parent2d3181ab808145fbdbe657740b41c16e82db7c87 (diff)
downloaddotty-d8f1fa55af2d832c07d89abaf9ecffc44c6572f8.tar.gz
dotty-d8f1fa55af2d832c07d89abaf9ecffc44c6572f8.tar.bz2
dotty-d8f1fa55af2d832c07d89abaf9ecffc44c6572f8.zip
Performance tuning: Inline TypeAlias case for hot maps.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Inferencing.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Inferencing.scala6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/typer/Inferencing.scala b/src/dotty/tools/dotc/typer/Inferencing.scala
index c9319de1f..cd30f8ff6 100644
--- a/src/dotty/tools/dotc/typer/Inferencing.scala
+++ b/src/dotty/tools/dotc/typer/Inferencing.scala
@@ -521,6 +521,10 @@ object Inferencing {
case tp: NamedType => // default case, inlined for speed
if (tp.symbol.isStatic) tp
else tp.derivedSelect(wildApprox(tp.prefix, theMap))
+ case tp: RefinedType => // default case, inlined for speed
+ tp.derivedRefinedType(wildApprox(tp.parent, theMap), tp.refinedName, wildApprox(tp.refinedInfo, theMap))
+ case tp: TypeBounds if tp.lo eq tp.hi => // default case, inlined for speed
+ tp.derivedTypeAlias(wildApprox(tp.lo, theMap))
case PolyParam(pt, pnum) =>
WildcardType(wildApprox(pt.paramBounds(pnum)).bounds)
case MethodParam(mt, pnum) =>
@@ -554,8 +558,6 @@ object Inferencing {
tp.derivedViewProto(wildApprox(tp.argType), wildApprox(tp.resultType))
case _: ThisType | _: BoundType | NoPrefix => // default case, inlined for speed
tp
- case tp: RefinedType => // default case, inlined for speed
- tp.derivedRefinedType(wildApprox(tp.parent, theMap), tp.refinedName, wildApprox(tp.refinedInfo, theMap))
case _ =>
(if (theMap != null) theMap else new WildApproxMap).mapOver(tp)
}