summaryrefslogtreecommitdiff
path: root/src/reflect/scala/reflect/internal/TreeInfo.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2014-02-18 08:58:32 +0100
committerJason Zaugg <jzaugg@gmail.com>2014-02-18 09:11:53 +0100
commitfd623f83a1aa9852b334cd9a1444d10333df1d9a (patch)
tree558a784dba74279d3d519641fc46d4f3f359718b /src/reflect/scala/reflect/internal/TreeInfo.scala
parentb31f9ab97912ad2d26df16ef223b874970175388 (diff)
downloadscala-fd623f83a1aa9852b334cd9a1444d10333df1d9a.tar.gz
scala-fd623f83a1aa9852b334cd9a1444d10333df1d9a.tar.bz2
scala-fd623f83a1aa9852b334cd9a1444d10333df1d9a.zip
SI-8304 Allow volatile-typed Idents as stable ident patterns
As we did for `Select`-s in SI-6815 / fada1ef6.
Diffstat (limited to 'src/reflect/scala/reflect/internal/TreeInfo.scala')
-rw-r--r--src/reflect/scala/reflect/internal/TreeInfo.scala6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/reflect/scala/reflect/internal/TreeInfo.scala b/src/reflect/scala/reflect/internal/TreeInfo.scala
index 02db40f1de..b7df2e82cb 100644
--- a/src/reflect/scala/reflect/internal/TreeInfo.scala
+++ b/src/reflect/scala/reflect/internal/TreeInfo.scala
@@ -98,7 +98,7 @@ abstract class TreeInfo {
*/
def isStableIdentifier(tree: Tree, allowVolatile: Boolean): Boolean =
tree match {
- case i @ Ident(_) => isStableIdent(i)
+ case i @ Ident(_) => isStableIdent(i, allowVolatile)
case Select(qual, _) => isStableMemberOf(tree.symbol, qual, allowVolatile) && isPath(qual, allowVolatile)
case Apply(Select(free @ Ident(_), nme.apply), _) if free.symbol.name endsWith nme.REIFY_FREE_VALUE_SUFFIX =>
// see a detailed explanation of this trick in `GenSymbols.reifyFreeTerm`
@@ -119,11 +119,11 @@ abstract class TreeInfo {
typeOk(tree.tpe) && (allowVolatile || !hasVolatileType(tree)) && !definitions.isByNameParamType(tree.tpe)
)
- private def isStableIdent(tree: Ident): Boolean = (
+ private def isStableIdent(tree: Ident, allowVolatile: Boolean): Boolean = (
symOk(tree.symbol)
&& tree.symbol.isStable
&& !definitions.isByNameParamType(tree.tpe)
- && !tree.symbol.hasVolatileType // TODO SPEC: not required by spec
+ && (allowVolatile || !tree.symbol.hasVolatileType) // TODO SPEC: not required by spec
)
/** Is `tree`'s type volatile? (Ignored if its symbol has the @uncheckedStable annotation.)