summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Typers.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-10-13 21:07:11 +0000
committerPaul Phillips <paulp@improving.org>2011-10-13 21:07:11 +0000
commit1bd14badd7092596564572c601b47236818363ff (patch)
tree93a07a0711ade71075f0303394595ea1a22f8a6a /src/compiler/scala/tools/nsc/typechecker/Typers.scala
parente3b58d0c993aa4be16214ce52aea5952a9e5f877 (diff)
downloadscala-1bd14badd7092596564572c601b47236818363ff.tar.gz
scala-1bd14badd7092596564572c601b47236818363ff.tar.bz2
scala-1bd14badd7092596564572c601b47236818363ff.zip
Renamed isPureExpr to isExprSafeToInline.
Taking adriaan's advice for what name would better describe this method. Yours in reduction of ambiguous terminology, no review.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index d01cd829ac..0ecb8efea8 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -202,7 +202,7 @@ trait Typers extends Modes with Adaptations {
* @return ...
*/
def checkStable(tree: Tree): Tree =
- if (treeInfo.isPureExpr(tree)) tree
+ if (treeInfo.isExprSafeToInline(tree)) tree
else errorTree(
tree,
"stable identifier required, but "+tree+" found."+
@@ -223,7 +223,7 @@ trait Typers extends Modes with Adaptations {
val savedSTABLE = tree.symbol getFlag STABLE
tree.symbol setInfo AnyRefClass.tpe
tree.symbol setFlag STABLE
- val result = treeInfo.isPureExpr(tree)
+ val result = treeInfo.isExprSafeToInline(tree)
tree.symbol setInfo savedTpe
tree.symbol setFlag savedSTABLE
result
@@ -1976,7 +1976,7 @@ trait Typers extends Modes with Adaptations {
val stats1 = typedStats(block.stats, context.owner)
val expr1 = typed(block.expr, mode & ~(FUNmode | QUALmode), pt)
treeCopy.Block(block, stats1, expr1)
- .setType(if (treeInfo.isPureExpr(block)) expr1.tpe else expr1.tpe.deconst)
+ .setType(if (treeInfo.isExprSafeToInline(block)) expr1.tpe else expr1.tpe.deconst)
} finally {
// enable escaping privates checking from the outside and recycle
// transient flag
@@ -2136,7 +2136,7 @@ trait Typers extends Modes with Adaptations {
private def isWarnablePureExpression(tree: Tree) = tree match {
case EmptyTree | Literal(Constant(())) => false
case _ =>
- (treeInfo isPureExpr tree) && {
+ (treeInfo isExprSafeToInline tree) && {
val sym = tree.symbol
(sym == null) || !(sym.isModule || sym.isLazy) || {
debuglog("'Pure' but side-effecting expression in statement position: " + tree)