diff options
author | Martin Odersky <odersky@gmail.com> | 2014-05-06 10:32:56 +0200 |
---|---|---|
committer | Samuel Gruetter <samuel.gruetter@epfl.ch> | 2014-05-20 13:38:48 +0200 |
commit | 093774e181e878308551226f6a0b990bf7de8077 (patch) | |
tree | 6723ce0971db89d682d48bfacd0785980c322499 /src/dotty/tools/dotc/typer/Typer.scala | |
parent | 82c4db686d07ae8e91f157f5c8b55a1a76917941 (diff) | |
download | dotty-093774e181e878308551226f6a0b990bf7de8077.tar.gz dotty-093774e181e878308551226f6a0b990bf7de8077.tar.bz2 dotty-093774e181e878308551226f6a0b990bf7de8077.zip |
Fix of SI 2133
We now restrict wildcard imports to members that are accessible at the point of import. This is a fix of an open Scala ticket.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Typer.scala | 3 |
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 f4b52ce09..944b44510 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -70,6 +70,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit * (3) Change pattern Idents id (but not wildcards) to id @ _ */ def typedIdent(tree: untpd.Ident, pt: Type)(implicit ctx: Context): Tree = track("typedIdent") { + val refctx = ctx val name = tree.name /** Method is necessary because error messages need to bind to @@ -179,7 +180,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit if (imp.isWildcardImport) { val pre = imp.site if (!isDisabled(imp, pre) && !(imp.excluded contains name.toTermName)) { - val denot = pre.member(name) + val denot = pre.member(name).accessibleFrom(pre)(refctx) if (reallyExists(denot)) return pre.select(name, denot) } } |