diff options
author | Martin Odersky <odersky@gmail.com> | 2013-11-15 19:33:18 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-11-15 19:33:18 +0100 |
commit | 3d01335c750de022e87914f44e017051abac290f (patch) | |
tree | ee97f48087be9fcf4298139a05ca0093a39ccc06 /src/dotty/tools/dotc/typer/Typer.scala | |
parent | 6ca5d414e729a509a00ddc508f2abf3d24da56ca (diff) | |
download | dotty-3d01335c750de022e87914f44e017051abac290f.tar.gz dotty-3d01335c750de022e87914f44e017051abac290f.tar.bz2 dotty-3d01335c750de022e87914f44e017051abac290f.zip |
Converting most uses of NamedType to select.
Select reduces refinetype/typeref pairs and is therefore preferable over raw NamedType.
Still need to do the same for TypeRefs.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Typer.scala | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala index bf9572a46..9780e8d2e 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -68,10 +68,10 @@ class Typer extends Namer with Applications with Implicits { private var importedFromRoot: Set[Symbol] = Set() def selectionType(site: Type, name: Name, pos: Position)(implicit ctx: Context): Type = { - val ref = + val refDenot = if (name == nme.CONSTRUCTOR) site.decl(name) else site.member(name) - if (ref.exists) NamedType(site, name).withDenot(ref) + if (refDenot.exists) site.select(name, refDenot) else { if (!site.isErroneous) ctx.error( @@ -253,7 +253,7 @@ class Typer extends Namer with Applications with Implicits { val pre = imp.site if (!isDisabled(imp, pre)) { val denot = pre.member(name) - if (denot.exists) return NamedType(pre, name).withDenot(denot) + if (denot.exists) return pre.select(name, denot) } } NoType @@ -275,7 +275,7 @@ class Typer extends Namer with Applications with Implicits { val defDenot = ctx.denotNamed(name) if (defDenot.exists) { val curOwner = ctx.owner - val found = NamedType(curOwner.thisType, name) withDenot defDenot + val found = curOwner.thisType.select(name, defDenot) if (!(curOwner is Package) || (defDenot.symbol is Package) || isDefinedInCurrentUnit(defDenot)) return checkNewOrShadowed(found, definition) // no need to go further out, we found highest prec entry else if (prevPrec < packageClause) |