diff options
author | Paul Phillips <paulp@improving.org> | 2010-12-02 17:28:58 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-12-02 17:28:58 +0000 |
commit | 765f9aa2bfd16fc066fcfe6f068bc9ab54b863c2 (patch) | |
tree | 1b8d31bab45162415d6cc6372c7336fc62bbad2b /lib | |
parent | a69c1afd4ba602bd4ccc9f9aced9bfc0f6f3c5e7 (diff) | |
download | scala-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 'lib')
0 files changed, 0 insertions, 0 deletions