summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Namers.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-12-02 17:28:58 +0000
committerPaul Phillips <paulp@improving.org>2010-12-02 17:28:58 +0000
commit765f9aa2bfd16fc066fcfe6f068bc9ab54b863c2 (patch)
tree1b8d31bab45162415d6cc6372c7336fc62bbad2b /src/compiler/scala/tools/nsc/typechecker/Namers.scala
parenta69c1afd4ba602bd4ccc9f9aced9bfc0f6f3c5e7 (diff)
downloadscala-765f9aa2bfd16fc066fcfe6f068bc9ab54b863c2.tar.gz
scala-765f9aa2bfd16fc066fcfe6f068bc9ab54b863c2.tar.bz2
scala-765f9aa2bfd16fc066fcfe6f068bc9ab54b863c2.zip
It's a big one!
TermName and TypeName are exposed throughout the compiler based on what kind of name a given abstraction ought to have. (There remain places where one needs to create a name without knowing yet what it will be, and those will always be Names.) The nme object in the compiler now holds only term names. To reference a known type name, use tpnme: nme.List == ("List": TermName) tpnme.List == ("List": TypeName) The contents of nme and tpname are defined in traits, many of which are shared, so if a name should exist only as a Type and not a Term, it should be defined in CompilerTypeNames, but otherwise in CompilerTermNames or CompilerCommonNames. This is partially complete but I'm sure there are still many shared which should pick a side. Usage of .toTermName and .toTypeName is strongly discouraged. After the dust has settled, there will be very few places where it will make sense to hop between namespaces like that. There are some implicits to smooth everything out, most of which should be removable eventually. // these two are in no hurry to go anywhere String => TermName String => TypeName // but not String => Name: def view in the compiler is no longer implicit // these two are temporary, and can log when they kick off to help us flush // out remaining issues of "name migration" Name => TermName Name => TypeName There is more work to be done before we're properly protected from naming errors, but I will not allow another eight hour tragedy to befall lukas or anyone else! Review by rytz. (Formality.)
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Namers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Namers.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
index 0d614af3ac..e1a8daf6c8 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
@@ -1206,7 +1206,7 @@ trait Namers { self: Analyzer =>
if (currentRun.compileSourceFor(expr, from))
return typeSig(tree)
// for Java code importing Scala objects
- if (from.endsWith(nme.DOLLARraw))
+ if (from.endsWith(nme.raw.DOLLAR))
isValidSelector(from.subName(0, from.length -1)) {
context.error(tree.pos, from.decode + " is not a member of " + expr)
}