aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/core
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2017-01-15 21:46:25 +1100
committerMartin Odersky <odersky@gmail.com>2017-01-15 21:46:25 +1100
commiteb1063725d74395a86b3191fc658b7963f07c4b5 (patch)
treee913c46b4034c9a596027a3b179cc897013b5531 /compiler/src/dotty/tools/dotc/core
parentba7e12999dc645dbcba04cf365dfd4d621ee4662 (diff)
downloaddotty-eb1063725d74395a86b3191fc658b7963f07c4b5.tar.gz
dotty-eb1063725d74395a86b3191fc658b7963f07c4b5.tar.bz2
dotty-eb1063725d74395a86b3191fc658b7963f07c4b5.zip
Adopt scala's scheme for root import hiding
scalac hides a root import from Predef if there is an eplicit Predef import. We now do the same (previously we did this only if the overriding import undefined something, using a `x => _` syntax). To avoid cycles and races one had to be very careful not to force import symbols too early, so we now compare the name before the symbol proper. All this is likely temporary - the comment of ImportInfo#unimported points to a different, more systematic solution.
Diffstat (limited to 'compiler/src/dotty/tools/dotc/core')
-rw-r--r--compiler/src/dotty/tools/dotc/core/Definitions.scala1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/src/dotty/tools/dotc/core/Definitions.scala b/compiler/src/dotty/tools/dotc/core/Definitions.scala
index 45e37eb8b..134b31519 100644
--- a/compiler/src/dotty/tools/dotc/core/Definitions.scala
+++ b/compiler/src/dotty/tools/dotc/core/Definitions.scala
@@ -747,6 +747,7 @@ class Definitions {
else if (ctx.settings.YnoPredef.value) StaticRootImportFns
else StaticRootImportFns ++ PredefImportFns
+ lazy val ShadowableImportNames = Set("Predef", "DottyPredef").map(_.toTermName)
lazy val RootImportTypes = RootImportFns.map(_())
/** Modules whose members are in the default namespace and their module classes */