diff options
author | Paul Phillips <paulp@improving.org> | 2012-10-13 14:43:35 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-10-13 15:07:00 -0700 |
commit | 1b9a58848db469a5922678add7cc150faccd4dc8 (patch) | |
tree | 20fffc5eccf1d96f791f2d143a269f8f07d90e12 /src/intellij | |
parent | 25ad7876a97aafb7a33283843b05023e48cedc55 (diff) | |
download | scala-1b9a58848db469a5922678add7cc150faccd4dc8.tar.gz scala-1b9a58848db469a5922678add7cc150faccd4dc8.tar.bz2 scala-1b9a58848db469a5922678add7cc150faccd4dc8.zip |
Changes Tree and Type members from vals to defs.
Explanatory email:
The reflection API defines a great many abstract vals. I would
like these all to be defs. I'm sending a pull request to that end.
Reasons: for starters, they should default to being defs. It's a
decision to use vals for which one should have to supply reasons.
The reason for THAT is that defs can be implemented with vals, but
not vice versa.
Why does this matter? I can't find my long writing on the subject
of TypeRef. In short, we waste a huge amount of memory on its
fields, because given the way TypeRef is defined, each one demands
a pre, a sym, and an args. Except that somewhere between 1/3 and
1/2 have prefix "NoPrefix", and somewhere between 1/3 and 1/2 have
args "Nil". We know it at creation time, but we give every typeref
the whole field anyway.
At present there's no way to fix this which has acceptable
performance - i.e. custom subclasses save us lots of memory, but
are too much slower for having to use an extractor - but there's
no reason we should have to choose, and I fully expect to fix it
eventually. Let's not make that fix into a breaking change by
abstractly defining "pre" and "args" as field-requiring vals.
Diffstat (limited to 'src/intellij')
0 files changed, 0 insertions, 0 deletions