scala/scala — pull request #851 by paulp (2012-07-08 18:52:52+00:00)
Title: Added a HIDDEN flag.

[Still not a fan of the massive overlap between GenJVM and GenASM. I do
not think such duplication should be allowed into master at all, neither
in experimental backends nor anywhere else. Putting us in the position
that we have to actually switch to stop incurring the duplication is
engineering-by-prayer.]

The SYNTHETIC flag was long ago discovered to be inadequately specific
to allow for emitting ACC_SYNTHETIC in bytecode. In this commit is born
a HIDDEN flag, which signals the flagged symbol as implementation detail
which should not be considered during typechecking, and which will
receive ACC_SYNTHETIC during code generation.

Unsure what should be hidden, I conservatively marked a few things which
seem safely hidable.

- $outer fields and accessors
- classes whose classfile has the jvm Synthetic attribute
(not to be confused with the SYNTHETIC flag)

I leave additional choices to those who have a better idea how
this will materialize (i.e. IDE guys.)

It is easy to selectively introduce this flag; but the SYNTHETIC flag
is set or checked for in so many places, it is very difficult to alter
the logic around it (either by setting it less, or checking for HIDDEN
only) with much confidence. So right now HIDDEN is only used to help
ACC_SYNTHETIC make it into bytecode - it is only set in conjunction with
SYNTHETIC, and it doesn't help anyone hide from the typechecker.

Review by @dragos, @odersky.