aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/typer/Typer.scala
diff options
context:
space:
mode:
authorFelix Mulder <felix.mulder@gmail.com>2016-11-24 13:09:28 +0100
committerGitHub <noreply@github.com>2016-11-24 13:09:28 +0100
commit3599c243c86ae0a926ef45a435d38b7878dc322f (patch)
tree652ba7ea49bd791149bef5d51439d4d671e14c09 /compiler/src/dotty/tools/dotc/typer/Typer.scala
parente0439545c598478a9c619ae704d7859f866e0664 (diff)
parent2f1a7946c01f3f08d4354465e6890c4214faf328 (diff)
downloaddotty-3599c243c86ae0a926ef45a435d38b7878dc322f.tar.gz
dotty-3599c243c86ae0a926ef45a435d38b7878dc322f.tar.bz2
dotty-3599c243c86ae0a926ef45a435d38b7878dc322f.zip
Merge pull request #1739 from dotty-staging/topic/environmentally-friendly-tests
Environmentally friendly tests
Diffstat (limited to 'compiler/src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r--compiler/src/dotty/tools/dotc/typer/Typer.scala15
1 files changed, 10 insertions, 5 deletions
diff --git a/compiler/src/dotty/tools/dotc/typer/Typer.scala b/compiler/src/dotty/tools/dotc/typer/Typer.scala
index 64936e106..9f5a942d6 100644
--- a/compiler/src/dotty/tools/dotc/typer/Typer.scala
+++ b/compiler/src/dotty/tools/dotc/typer/Typer.scala
@@ -120,15 +120,20 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
}
else false
- /** A symbol qualifies if it really exists. In addition,
- * if we are in a constructor of a pattern, we ignore all definitions
+ /** A symbol qualifies if it really exists and is not a package class.
+ * In addition, if we are in a constructor of a pattern, we ignore all definitions
* which are methods and not accessors (note: if we don't do that
* case x :: xs in class List would return the :: method).
+ *
+ * Package classes are part of their parent's scope, because otherwise
+ * we could not reload them via `_.member`. On the other hand, accessing a
+ * package as a type from source is always an error.
*/
def qualifies(denot: Denotation): Boolean =
- reallyExists(denot) && !(
- pt.isInstanceOf[UnapplySelectionProto] &&
- (denot.symbol is (Method, butNot = Accessor)))
+ reallyExists(denot) &&
+ !(pt.isInstanceOf[UnapplySelectionProto] &&
+ (denot.symbol is (Method, butNot = Accessor))) &&
+ !(denot.symbol is PackageClass)
/** Find the denotation of enclosing `name` in given context `ctx`.
* @param previous A denotation that was found in a more deeply nested scope,