aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Typer.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-06-19 04:45:24 +0200
committerMartin Odersky <odersky@gmail.com>2013-06-19 04:48:11 +0200
commitb2dcc777e5a6a1e6d1fff89c7fa794129ad5d135 (patch)
tree2bac3a26ea6f7d62d713206687ba631c3c1cfad5 /src/dotty/tools/dotc/typer/Typer.scala
parent928a2a99288c3aa425654e63aea5ddc70359d4ac (diff)
downloaddotty-b2dcc777e5a6a1e6d1fff89c7fa794129ad5d135.tar.gz
dotty-b2dcc777e5a6a1e6d1fff89c7fa794129ad5d135.tar.bz2
dotty-b2dcc777e5a6a1e6d1fff89c7fa794129ad5d135.zip
Taking accessibility into account for &, |
Changed the algorithm for & (and also |) to take accessibility into account. Fixed various problems that opened up when doing this. Under -debug, new and old behavior of & are checked side-by-side and any discrepancy is noted.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Typer.scala3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala
index 47ffa40ce..4861b3949 100644
--- a/src/dotty/tools/dotc/typer/Typer.scala
+++ b/src/dotty/tools/dotc/typer/Typer.scala
@@ -158,7 +158,8 @@ class Typer extends Namer {
if (curOwner.isClass && (curOwner ne outer.owner)) curOwner.asClass.membersNamed(name)
else curScope.denotsNamed(name)
if (defDenots.exists) {
- val found = NamedType(curOwner.thisType, name).withDenot(defDenots.toDenot)
+ val pre = curOwner.thisType
+ val found = NamedType(pre, name).withDenot(defDenots toDenot pre)
if (!(curOwner is Package) || isDefinedInCurrentUnit(defDenots))
return checkNewOrShadowed(found, definition) // no need to go further out, we found highest prec entry
else if (prevPrec < packageClause)