diff options
author | Martin Odersky <odersky@gmail.com> | 2013-07-11 10:08:05 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-07-11 10:08:05 +0200 |
commit | 62ac6eb04b32ad9795754143d8934343ed3d9a8f (patch) | |
tree | 49610f5d49bf00be0194ac9e5e1629b9a5f8df78 /src/dotty/tools/dotc/core/Symbols.scala | |
parent | c9679f6c0f3c8200e1b1f537e89488094cfc2576 (diff) | |
download | dotty-62ac6eb04b32ad9795754143d8934343ed3d9a8f.tar.gz dotty-62ac6eb04b32ad9795754143d8934343ed3d9a8f.tar.bz2 dotty-62ac6eb04b32ad9795754143d8934343ed3d9a8f.zip |
Avoided cycle in newCompletePackageSymbol by passing name explicity.
Diffstat (limited to 'src/dotty/tools/dotc/core/Symbols.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Symbols.scala | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/dotty/tools/dotc/core/Symbols.scala b/src/dotty/tools/dotc/core/Symbols.scala index f45e3e140..9025a7df9 100644 --- a/src/dotty/tools/dotc/core/Symbols.scala +++ b/src/dotty/tools/dotc/core/Symbols.scala @@ -125,7 +125,7 @@ trait Symbols { this: Context => infoFn(module, modcls), privateWithin) val mdenot = SymDenotation( module, owner, name, modFlags | ModuleCreationFlags, - if (cdenot.isCompleted) TypeRef.withSym(owner.thisType, modcls) + if (cdenot.isCompleted) TypeRef.withSym(owner.thisType, modclsName, modcls) else new ModuleCompleter(modcls)(condensed)) module.denot = mdenot modcls.denot = cdenot @@ -150,7 +150,7 @@ trait Symbols { this: Context => newModuleSymbol( owner, name, modFlags, clsFlags, (module, modcls) => ClassInfo( - owner.thisType, modcls, parents, decls, TermRef.withSym(owner.thisType, module)), + owner.thisType, modcls, parents, decls, TermRef.withSym(owner.thisType, name, module)), privateWithin, coord, assocFile) /** Create a package symbol with associated package class @@ -185,14 +185,14 @@ trait Symbols { this: Context => val normalizedOwner = if (owner is ModuleVal) owner.moduleClass else owner println(s"creating stub for ${name.show}, owner = ${normalizedOwner.denot.debugString}, file = $file") println(s"decls = ${normalizedOwner.decls.toList.map(_.debugString).mkString("\n ")}") // !!! DEBUG - throw new Error() + if (base.settings.debug.value) throw new Error() val stub = name match { case name: TermName => newModuleSymbol(normalizedOwner, name, EmptyFlags, EmptyFlags, stubCompleter, assocFile = file) case name: TypeName => newClassSymbol(normalizedOwner, name, EmptyFlags, stubCompleter, assocFile = file) } - stub.info //!!! DEBUG, force the error for now + //stub.info //!!! DEBUG, force the error for now stub } @@ -293,13 +293,13 @@ object Symbols { type ThisName <: Name - private[this] var _id: Int = _ + private[this] var _id: Int = { + //assert(id != 144972) + nextId + } /** The unique id of this symbol */ - def id/*(implicit ctx: Context)*/ = { // !!! DEBUG - if (_id == 0) _id = /*ctx.*/nextId // !!! DEBUG - _id - } + def id = _id /** The last denotation of this symbol */ private[this] var lastDenot: SymDenotation = _ |