diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2012-08-10 13:01:25 +0200 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2012-08-13 22:30:23 +0200 |
commit | 37a290b02ef09c7e563239d878088aa30405eecb (patch) | |
tree | 60276435304a47a46fee2f5bd7c4b015a34ab7a3 /src/reflect/scala/reflect/internal/Symbols.scala | |
parent | 0e2080e8bf1c54cac59c5b0c53a93eb0de009d3b (diff) | |
download | scala-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/Symbols.scala')
-rw-r--r-- | src/reflect/scala/reflect/internal/Symbols.scala | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/reflect/scala/reflect/internal/Symbols.scala b/src/reflect/scala/reflect/internal/Symbols.scala index 2a306d7c6e..824877f1e2 100644 --- a/src/reflect/scala/reflect/internal/Symbols.scala +++ b/src/reflect/scala/reflect/internal/Symbols.scala @@ -66,6 +66,7 @@ trait Symbols extends api.Symbols { self: SymbolTable => def isExistential: Boolean = this.isExistentiallyBound def isParamWithDefault: Boolean = this.hasDefault def isByNameParam: Boolean = this.isValueParameter && (this hasFlag BYNAMEPARAM) + def isImplementationArtifact: Boolean = (this hasFlag BRIDGE) || (this hasFlag VBRIDGE) || (this hasFlag ARTIFACT) def newNestedSymbol(name: Name, pos: Position, newFlags: Long, isClass: Boolean): Symbol = name match { case n: TermName => newTermSymbol(n, pos, newFlags) @@ -690,13 +691,13 @@ trait Symbols extends api.Symbols { self: SymbolTable => /** Is this symbol an accessor method for outer? */ final def isOuterAccessor = { - hasFlag(STABLE | HIDDEN) && + hasFlag(STABLE | ARTIFACT) && originalName == nme.OUTER } /** Is this symbol an accessor method for outer? */ final def isOuterField = { - hasFlag(HIDDEN) && + hasFlag(ARTIFACT) && originalName == nme.OUTER_LOCAL } |