diff options
author | Martin Odersky <odersky@gmail.com> | 2014-02-25 11:13:38 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-02-25 11:13:38 +0100 |
commit | f0ddc9afbef266d3a8f826b2c4e5249dca88242f (patch) | |
tree | 3c2bbe58dca00c12a437af3d2e47ce300d1d8281 /src/dotty/tools/dotc/typer/Typer.scala | |
parent | a995ab85b7747275a1798cf29ac54466fbe82e2f (diff) | |
download | dotty-f0ddc9afbef266d3a8f826b2c4e5249dca88242f.tar.gz dotty-f0ddc9afbef266d3a8f826b2c4e5249dca88242f.tar.bz2 dotty-f0ddc9afbef266d3a8f826b2c4e5249dca88242f.zip |
Performance improvement: Avoid most operations in interpolateUndetVars
Perform the operation only if there are qualifying type variables, which is rarely the case.
Reverted variances optimization to simpler and shorter previous implementation, because variances
is no longer hot.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Typer.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala index 49792cb73..7e44f6a76 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -84,8 +84,8 @@ class Typer extends Namer with Applications with Implicits { /** The type of a selection with `name` of a tree with type `site`. */ def selectionType(site: Type, name: Name, pos: Position)(implicit ctx: Context): Type = { - val refDenot = site.member(name) - if (reallyExists(refDenot)) site.select(name, refDenot) + val mbr = site.member(name) + if (reallyExists(mbr)) site.select(name, mbr) else { if (!site.isErroneous) { typr.println(s"site = $site, baseClasses = ${site.baseClasses}") |