aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Symbols.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-04-05 16:54:10 +0200
committerMartin Odersky <odersky@gmail.com>2013-04-05 16:54:40 +0200
commit4ce196d8152f75163edb362fcd21fb37631b7fde (patch)
treeb1bfe19ab22935474b0be5939d61e93c8e86719a /src/dotty/tools/dotc/core/Symbols.scala
parent859840dd0662a12fbc1ba470438eca779b08ed89 (diff)
downloaddotty-4ce196d8152f75163edb362fcd21fb37631b7fde.tar.gz
dotty-4ce196d8152f75163edb362fcd21fb37631b7fde.tar.bz2
dotty-4ce196d8152f75163edb362fcd21fb37631b7fde.zip
Made module class names end in '$'.
If module classes have the same names as their companion classes there is the latent trap that TypeRefs refer to one or the other. To avoid cross-talk, module classes need to have a different name. Also, some fixes to baseType, isSubClass in SymDenotations.
Diffstat (limited to 'src/dotty/tools/dotc/core/Symbols.scala')
-rw-r--r--src/dotty/tools/dotc/core/Symbols.scala6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/core/Symbols.scala b/src/dotty/tools/dotc/core/Symbols.scala
index 739d56d2f..ee53b0368 100644
--- a/src/dotty/tools/dotc/core/Symbols.scala
+++ b/src/dotty/tools/dotc/core/Symbols.scala
@@ -11,7 +11,7 @@ import Decorators._
import Symbols._
import Contexts._
import SymDenotations._, util.Texts._
-import Types._, Annotations._, Positions._, StdNames._, Trees._
+import Types._, Annotations._, Positions._, StdNames._, Trees._, NameOps._
import Denotations.{ Denotation, SingleDenotation, MultiDenotation }
import collection.mutable
import io.AbstractFile
@@ -116,8 +116,10 @@ trait Symbols { this: Context =>
val base = owner.thisType
val module = newNakedSymbol[TermName](coord)
val modcls = newNakedClassSymbol(coord, assocFile)
+ val modclsFlags = clsFlags | ModuleClassCreationFlags
+ val modclsName = name.toTypeName.adjustIfModuleClass(modclsFlags)
val cdenot = SymDenotation(
- modcls, owner, name.toTypeName, clsFlags | ModuleClassCreationFlags,
+ modcls, owner, modclsName, modclsFlags,
infoFn(module, modcls), privateWithin)
val mdenot = SymDenotation(
module, owner, name, modFlags | ModuleCreationFlags,