summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2013-02-01 10:23:15 -0800
committerPaul Phillips <paulp@improving.org>2013-02-01 10:23:15 -0800
commita6be362484680fcde3a2706dd84bb5050bee5a06 (patch)
tree7dd7d997dab2ed05756fa61686268d81c9b5da3c /src
parent407e123572e751f1be6e0f1a84b4a9d95b2bdfe2 (diff)
parentfd6fe4e428948cbbc3feb5ee186f784e0205d697 (diff)
downloadscala-a6be362484680fcde3a2706dd84bb5050bee5a06.tar.gz
scala-a6be362484680fcde3a2706dd84bb5050bee5a06.tar.bz2
scala-a6be362484680fcde3a2706dd84bb5050bee5a06.zip
Merge pull request #2027 from paulp/pr/fix-empty-package
Fix access to empty package from the repl.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index 94edc6067a..5217911d19 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -3981,7 +3981,8 @@ trait Typers extends Adaptations with Tags {
// Lookup in the given qualifier. Used in last-ditch efforts by typedIdent and typedSelect.
def lookupInRoot(name: Name): Symbol = lookupInOwner(rootMirror.RootClass, name)
- def lookupInEmpty(name: Name): Symbol = lookupInOwner(rootMirror.EmptyPackageClass, name)
+ def lookupInEmpty(name: Name): Symbol = rootMirror.EmptyPackageClass.info member name
+
def lookupInQualifier(qual: Tree, name: Name): Symbol = (
if (name == nme.ERROR || qual.tpe.widen.isErroneous)
NoSymbol
@@ -4775,7 +4776,7 @@ trait Typers extends Adaptations with Tags {
* (2) Change imported symbols to selections
*/
def typedIdent(tree: Tree, name: Name): Tree = {
- // setting to enable unqualified idents in empty package
+ // setting to enable unqualified idents in empty package (used by the repl)
def inEmptyPackage = if (settings.exposeEmptyPackage.value) lookupInEmpty(name) else NoSymbol
def issue(err: AbsTypeError) = {