aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/core/SymbolLoaders.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2017-03-22 11:18:36 +0100
committerMartin Odersky <odersky@gmail.com>2017-04-11 09:33:10 +0200
commit67105e3f36378d652aa919e23aa3b2678004bdc6 (patch)
tree66518be63b607e3766982fb081b31eca0726d2fa /compiler/src/dotty/tools/dotc/core/SymbolLoaders.scala
parent01d9659e21a149801fd8ced6652cc0e94f4827e2 (diff)
downloaddotty-67105e3f36378d652aa919e23aa3b2678004bdc6.tar.gz
dotty-67105e3f36378d652aa919e23aa3b2678004bdc6.tar.bz2
dotty-67105e3f36378d652aa919e23aa3b2678004bdc6.zip
Start to use structured ModuleNames
Subject to flags Config.semanticNames.
Diffstat (limited to 'compiler/src/dotty/tools/dotc/core/SymbolLoaders.scala')
-rw-r--r--compiler/src/dotty/tools/dotc/core/SymbolLoaders.scala10
1 files changed, 7 insertions, 3 deletions
diff --git a/compiler/src/dotty/tools/dotc/core/SymbolLoaders.scala b/compiler/src/dotty/tools/dotc/core/SymbolLoaders.scala
index 79f8a6a45..40e561d3f 100644
--- a/compiler/src/dotty/tools/dotc/core/SymbolLoaders.scala
+++ b/compiler/src/dotty/tools/dotc/core/SymbolLoaders.scala
@@ -39,7 +39,7 @@ class SymbolLoaders {
def enterClass(
owner: Symbol, name: PreName, completer: SymbolLoader,
flags: FlagSet = EmptyFlags, scope: Scope = EmptyScope)(implicit ctx: Context): Symbol = {
- val cls = ctx.newClassSymbol(owner, name.toTypeName, flags, completer, assocFile = completer.sourceFileOrNull)
+ val cls = ctx.newClassSymbol(owner, name.toTypeName.unmangleClassName, flags, completer, assocFile = completer.sourceFileOrNull)
enterNew(owner, cls, completer, scope)
}
@@ -152,7 +152,7 @@ class SymbolLoaders {
def doComplete(root: SymDenotation)(implicit ctx: Context): Unit = {
assert(root is PackageClass, root)
- def maybeModuleClass(classRep: ClassPath#ClassRep) = classRep.name.last == '$'
+ def maybeModuleClass(classRep: ClassPath#ClassRep) = classRep.name.last == '$'
val pre = root.owner.thisType
root.info = ClassInfo(pre, root.symbol.asClass, Nil, currentDecls, pre select sourceModule)
if (!sourceModule.isCompleted)
@@ -162,7 +162,8 @@ class SymbolLoaders {
if (!maybeModuleClass(classRep))
initializeFromClassPath(root.symbol, classRep)
for (classRep <- classpath.classes)
- if (maybeModuleClass(classRep) && !root.unforcedDecls.lookup(classRep.name.toTypeName).exists)
+ if (maybeModuleClass(classRep) &&
+ !root.unforcedDecls.lookup(classRep.name.toTypeName.unmangleClassName).exists)
initializeFromClassPath(root.symbol, classRep)
}
if (!root.isEmptyPackage)
@@ -247,8 +248,11 @@ class ClassfileLoader(val classfile: AbstractFile) extends SymbolLoader {
(module, _) => new NoCompleter() withDecls newScope withSourceModule (_ => module))
.moduleClass.denot.asClass
}
+ val res =
if (rootDenot is ModuleClass) (linkedDenot, rootDenot)
else (rootDenot, linkedDenot)
+ println(s"root denots of ${rootDenot.name.debugString} = ${res._1.name.debugString}, ${res._2.name.debugString} / ${rootDenot is ModuleClass}")
+ res
}
override def doComplete(root: SymDenotation)(implicit ctx: Context): Unit =