diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2014-01-27 15:45:18 +0300 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2014-02-12 14:53:48 +0100 |
commit | c34b24a6c4b75a6215bdb8fd8ff94ce869430435 (patch) | |
tree | 4792a96322e2f30b7fe1830091cf748503636bfc /src/compiler/scala/tools/nsc/ast/parser/Parsers.scala | |
parent | 7c06c9d7f6a12c2b13c83b195fffa30c5a4ec3ce (diff) | |
download | scala-c34b24a6c4b75a6215bdb8fd8ff94ce869430435.tar.gz scala-c34b24a6c4b75a6215bdb8fd8ff94ce869430435.tar.bz2 scala-c34b24a6c4b75a6215bdb8fd8ff94ce869430435.zip |
disambiguates uses of “local” in internal symbol API
There’s been a conflation of two distinct meanings of the word “local”
in the internal symbol API: the first meaning being “local to this”
(as in has the LOCAL flag set), the second meaning being “local to block”
(as in declared in a block, i.e. having owner being a term symbol).
Especially confusing is the fact that sym.isLocal isn’t the same as
sym.hasFlag(LOCAL), which has led to now fixed SI-6733.
This commit fixes the semantic mess by deprecating both Symbol.isLocal and
Symbol.hasLocalFlag (that we were forced to use, because Symbol.isLocal
had already been taken), and replacing them with Symbol.isLocalToThis
and Symbol.isLocalToBlock. Unfortunately, we can’t remove the deprecated
methods right away, because they are used in SBT, so I had to take small
steps.
Diffstat (limited to 'src/compiler/scala/tools/nsc/ast/parser/Parsers.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/parser/Parsers.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala index e3d2bf14a0..0a753f157c 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala @@ -2234,7 +2234,7 @@ self => } else { // XX-METHOD-INFER accept(COLON) if (in.token == ARROW) { - if (owner.isTypeName && !mods.hasLocalFlag) + if (owner.isTypeName && !mods.isLocalToThis) syntaxError( in.offset, (if (mods.isMutable) "`var'" else "`val'") + |