summaryrefslogtreecommitdiff
path: root/src/reflect/scala/reflect/internal/HasFlags.scala
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2012-08-10 13:01:25 +0200
committerEugene Burmako <xeno.by@gmail.com>2012-08-13 22:30:23 +0200
commit37a290b02ef09c7e563239d878088aa30405eecb (patch)
tree60276435304a47a46fee2f5bd7c4b015a34ab7a3 /src/reflect/scala/reflect/internal/HasFlags.scala
parent0e2080e8bf1c54cac59c5b0c53a93eb0de009d3b (diff)
downloadscala-37a290b02ef09c7e563239d878088aa30405eecb.tar.gz
scala-37a290b02ef09c7e563239d878088aa30405eecb.tar.bz2
scala-37a290b02ef09c7e563239d878088aa30405eecb.zip
HIDDEN => ARTIFACT
This test is necessary in the API to tell apart useful synthetic symbols (such as accessors) and low-level compilation artifacts (such as $outer). However `isHidden` (as it's currently named in the compiler) is too generic. Hence I renamed it along with the corresponding flag. Now the test says `isArtifact` and the flag is named ARTIFACT. Despite being an improvement over the first version, `isArtifact` is still a bit unlucky. The name I like is `isImplementationArtifact`, but that's a mouthful to be used in compiler hacking. Moreover, IMPLEMENTATION_ARTIFACT looks weird. For a discussion about related stuff see: http://groups.google.com/group/scala-internals/browse_thread/thread/d04e762127737968 https://github.com/scala/scala/pull/1114
Diffstat (limited to 'src/reflect/scala/reflect/internal/HasFlags.scala')
-rw-r--r--src/reflect/scala/reflect/internal/HasFlags.scala8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/reflect/scala/reflect/internal/HasFlags.scala b/src/reflect/scala/reflect/internal/HasFlags.scala
index 7ead9d6a1b..62c8ed702b 100644
--- a/src/reflect/scala/reflect/internal/HasFlags.scala
+++ b/src/reflect/scala/reflect/internal/HasFlags.scala
@@ -66,7 +66,7 @@ trait HasFlags {
*/
def flagString: String = flagString(flagMask)
def flagString(mask: Long): String = calculateFlagString(flags & mask)
-
+
/** The default mask determining which flags to display.
*/
def flagMask: Long = AllFlags
@@ -92,7 +92,7 @@ trait HasFlags {
def isCaseAccessor = hasFlag(CASEACCESSOR)
def isDeferred = hasFlag(DEFERRED)
def isFinal = hasFlag(FINAL)
- def isHidden = hasFlag(HIDDEN)
+ def isArtifact = hasFlag(ARTIFACT)
def isImplicit = hasFlag(IMPLICIT)
def isInterface = hasFlag(INTERFACE)
def isJavaDefined = hasFlag(JAVA)
@@ -136,7 +136,7 @@ trait HasFlags {
def accessString: String = {
val pw = if (hasAccessBoundary) privateWithin.toString else ""
-
+
if (pw == "") {
if (hasAllFlags(PrivateLocal)) "private[this]"
else if (hasAllFlags(ProtectedLocal)) "protected[this]"
@@ -150,7 +150,7 @@ trait HasFlags {
protected def calculateFlagString(basis: Long): String = {
val access = accessString
val nonAccess = flagBitsToString(basis & ~AccessFlags)
-
+
if (access == "") nonAccess
else if (nonAccess == "") access
else nonAccess + " " + access