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/ast | |
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/ast')
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala | 2 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/TreeGen.scala | 2 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/Trees.scala | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala b/src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala index 267a5dcefd..be7a6295b4 100644 --- a/src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala +++ b/src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala @@ -509,7 +509,7 @@ abstract class TreeBrowsers { /** Return a textual representation of this t's symbol */ def symbolText(t: Tree): String = { val prefix = - if (t.hasSymbol) "[has] " + if (t.hasSymbolField) "[has] " else if (t.isDef) "[defines] " else "" diff --git a/src/compiler/scala/tools/nsc/ast/TreeGen.scala b/src/compiler/scala/tools/nsc/ast/TreeGen.scala index 20da5f0087..a74b62bf8d 100644 --- a/src/compiler/scala/tools/nsc/ast/TreeGen.scala +++ b/src/compiler/scala/tools/nsc/ast/TreeGen.scala @@ -22,7 +22,7 @@ abstract class TreeGen extends scala.reflect.internal.TreeGen with TreeDSL { def mkCheckInit(tree: Tree): Tree = { val tpe = - if (tree.tpe != null || !tree.hasSymbol) tree.tpe + if (tree.tpe != null || !tree.hasSymbolField) tree.tpe else tree.symbol.tpe if (!global.phase.erasedTypes && settings.warnSelectNullable.value && diff --git a/src/compiler/scala/tools/nsc/ast/Trees.scala b/src/compiler/scala/tools/nsc/ast/Trees.scala index 3ccc595fb2..f6073cf185 100644 --- a/src/compiler/scala/tools/nsc/ast/Trees.scala +++ b/src/compiler/scala/tools/nsc/ast/Trees.scala @@ -341,7 +341,7 @@ trait Trees extends scala.reflect.internal.Trees { self: Global => tree case _ => val dupl = tree.duplicate - if (tree.hasSymbol && (!localOnly || (locals contains tree.symbol)) && !(keepLabels && tree.symbol.isLabel)) + if (tree.hasSymbolField && (!localOnly || (locals contains tree.symbol)) && !(keepLabels && tree.symbol.isLabel)) dupl.symbol = NoSymbol dupl.tpe = null dupl |