diff options
author | Paul Phillips <paulp@improving.org> | 2012-10-03 13:54:30 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-10-03 13:58:14 -0700 |
commit | dee6a347335e9a4b42342664aa50b0cb217c00a9 (patch) | |
tree | 19054a14a7e0dea902156183c1fec41a386c9cf4 /src/compiler/scala/tools/nsc/typechecker/Duplicators.scala | |
parent | 5132659241e25b7695b3203fe0bc5c81c17b65d3 (diff) | |
download | scala-dee6a347335e9a4b42342664aa50b0cb217c00a9.tar.gz scala-dee6a347335e9a4b42342664aa50b0cb217c00a9.tar.bz2 scala-dee6a347335e9a4b42342664aa50b0cb217c00a9.zip |
Renamed hasSymbol to hasSymbolField.
Suggestion by retronym that the obvious implementation of
"hasSymbol" be called "hasSymbol" reminded me we have a method
called "hasSymbol" which does not have that implementation, and
which has burned us already with subtle bugginess. I think that
"hasSymbolField" is self-documenting.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Duplicators.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Duplicators.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala b/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala index 2dd0836322..1bd2bbcd5c 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala @@ -233,7 +233,7 @@ abstract class Duplicators extends Analyzer { override def typed(tree: Tree, mode: Int, pt: Type): Tree = { debuglog("typing " + tree + ": " + tree.tpe + ", " + tree.getClass) val origtreesym = tree.symbol - if (tree.hasSymbol && tree.symbol != NoSymbol + if (tree.hasSymbolField && tree.symbol != NoSymbol && !tree.symbol.isLabel // labels cannot be retyped by the type checker as LabelDef has no ValDef/return type trees && invalidSyms.isDefinedAt(tree.symbol)) { debuglog("removed symbol " + tree.symbol) @@ -403,7 +403,7 @@ abstract class Duplicators extends Analyzer { case _ => debuglog("Duplicators default case: " + tree.summaryString) debuglog(" ---> " + tree) - if (tree.hasSymbol && tree.symbol != NoSymbol && (tree.symbol.owner == definitions.AnyClass)) { + if (tree.hasSymbolField && tree.symbol != NoSymbol && (tree.symbol.owner == definitions.AnyClass)) { tree.symbol = NoSymbol // maybe we can find a more specific member in a subclass of Any (see AnyVal members, like ==) } val ntree = castType(tree, pt) |