diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2014-02-18 09:17:51 +0100 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2014-02-18 09:17:51 +0100 |
commit | 185de09b79088e83f766d4b60adc896ad01edd31 (patch) | |
tree | be3c8a81e25b2f17a3da2fc8b72835e8d65484de /src | |
parent | 227808c11287fa4cd64afd750a8682d91a90a6e1 (diff) | |
parent | fd623f83a1aa9852b334cd9a1444d10333df1d9a (diff) | |
download | scala-185de09b79088e83f766d4b60adc896ad01edd31.tar.gz scala-185de09b79088e83f766d4b60adc896ad01edd31.tar.bz2 scala-185de09b79088e83f766d4b60adc896ad01edd31.zip |
Merge remote-tracking branch 'retronym/topic/8301' into topic/palladium0
Diffstat (limited to 'src')
-rw-r--r-- | src/reflect/scala/reflect/internal/TreeInfo.scala | 6 | ||||
-rw-r--r-- | src/reflect/scala/reflect/internal/Types.scala | 4 |
2 files changed, 5 insertions, 5 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.) diff --git a/src/reflect/scala/reflect/internal/Types.scala b/src/reflect/scala/reflect/internal/Types.scala index 3ede21d5e3..03e4bcd086 100644 --- a/src/reflect/scala/reflect/internal/Types.scala +++ b/src/reflect/scala/reflect/internal/Types.scala @@ -4166,8 +4166,8 @@ trait Types if (symHi.isTerm) (isSubType(tpLo, tpHi, depth) && - (!symHi.isStable || symLo.isStable) && // sub-member must remain stable - (!symLo.hasVolatileType || symHi.hasVolatileType)) // sub-member must not introduce volatility + (!symHi.isStable || symLo.isStable) && // sub-member must remain stable + (!symLo.hasVolatileType || symHi.hasVolatileType || tpHi.isWildcard)) // sub-member must not introduce volatility else if (symHi.isAbstractType) ((tpHi.bounds containsType tpLo) && kindsConform(symHi :: Nil, tpLo :: Nil, preLo, symLo.owner)) |