diff options
author | Martin Odersky <odersky@gmail.com> | 2014-02-22 13:40:37 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-02-24 18:56:48 +0100 |
commit | c673f2dc2be0e055bd08522f6e91ff704dc43e93 (patch) | |
tree | 348a0808e9226b0fb0e1680bff3fbd8e53493371 /src/dotty/tools/dotc/typer/Inferencing.scala | |
parent | 691bae22c373bc72ad77cdd1968c35a445c34437 (diff) | |
download | dotty-c673f2dc2be0e055bd08522f6e91ff704dc43e93.tar.gz dotty-c673f2dc2be0e055bd08522f6e91ff704dc43e93.tar.bz2 dotty-c673f2dc2be0e055bd08522f6e91ff704dc43e93.zip |
Performance improvements: Changes to TypeAccumulators and variances.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Inferencing.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Inferencing.scala | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/typer/Inferencing.scala b/src/dotty/tools/dotc/typer/Inferencing.scala index 19a6f3bb5..763904ac4 100644 --- a/src/dotty/tools/dotc/typer/Inferencing.scala +++ b/src/dotty/tools/dotc/typer/Inferencing.scala @@ -610,7 +610,7 @@ object Inferencing { constr.println(s"qualifying undet vars: ${constraint.uninstVars filter qualifies map (tvar => s"$tvar / ${tvar.show}")}, constraint: ${constraint.show}") def qualifies(tvar: TypeVar) = tree contains tvar.owningTree - val vs = tp.variances(tvar => (constraint contains tvar) && qualifies(tvar)) + val vs = tp.variances(qualifies) var changed = false vs foreachBinding { (tvar, v) => if (v != 0) { @@ -634,8 +634,7 @@ object Inferencing { * typevar is not uniquely determined, return that typevar in a Some. */ def maximizeType(tp: Type)(implicit ctx: Context): Option[TypeVar] = Stats.track("maximizeType") { - val constraint = ctx.typerState.constraint - val vs = tp.variances(constraint contains _) + val vs = tp.variances(alwaysTrue) var result: Option[TypeVar] = None vs foreachBinding { (tvar, v) => if (v == 1) tvar.instantiate(fromBelow = false) |