summaryrefslogtreecommitdiff
path: root/src/reflect/scala/reflect/internal/HasFlags.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-07-08 10:16:39 -0700
committerPaul Phillips <paulp@improving.org>2012-07-08 11:50:43 -0700
commit456d76d7f038891ffbd571eef06cf9d38425dc74 (patch)
tree10f93e647eb936720f9f6fefaefe10dc49ebc650 /src/reflect/scala/reflect/internal/HasFlags.scala
parent97a88cc3956414c898c4dab27f32cd7a9a367e3f (diff)
downloadscala-456d76d7f038891ffbd571eef06cf9d38425dc74.tar.gz
scala-456d76d7f038891ffbd571eef06cf9d38425dc74.tar.bz2
scala-456d76d7f038891ffbd571eef06cf9d38425dc74.zip
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.
Diffstat (limited to 'src/reflect/scala/reflect/internal/HasFlags.scala')
-rw-r--r--src/reflect/scala/reflect/internal/HasFlags.scala1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/reflect/scala/reflect/internal/HasFlags.scala b/src/reflect/scala/reflect/internal/HasFlags.scala
index c7c0882209..7ead9d6a1b 100644
--- a/src/reflect/scala/reflect/internal/HasFlags.scala
+++ b/src/reflect/scala/reflect/internal/HasFlags.scala
@@ -92,6 +92,7 @@ trait HasFlags {
def isCaseAccessor = hasFlag(CASEACCESSOR)
def isDeferred = hasFlag(DEFERRED)
def isFinal = hasFlag(FINAL)
+ def isHidden = hasFlag(HIDDEN)
def isImplicit = hasFlag(IMPLICIT)
def isInterface = hasFlag(INTERFACE)
def isJavaDefined = hasFlag(JAVA)