@@ -330,7 +330,7 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
330
330
}
331
331
332
332
/** The purity level of this expression.
333
- * @return PurePath if expression has no side effects and cannot contain local definitions
333
+ * @return SimplyPure if expression has no side effects and cannot contain local definitions
334
334
* Pure if expression has no side effects
335
335
* Idempotent if running the expression a second time has no side effects
336
336
* Impure otherwise
@@ -346,7 +346,7 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
346
346
| Super (_, _)
347
347
| Literal (_)
348
348
| Closure (_, _, _) =>
349
- PurePath
349
+ SimplyPure
350
350
case Ident (_) =>
351
351
refPurity(tree)
352
352
case Select (qual, _) =>
@@ -383,26 +383,26 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
383
383
384
384
private def minOf (l0 : PurityLevel , ls : List [PurityLevel ]) = (l0 /: ls)(_ min _)
385
385
386
- def isPurePath (tree : Tree )(implicit ctx : Context ) = exprPurity(tree) == PurePath
386
+ def isSimplyPure (tree : Tree )(implicit ctx : Context ) = exprPurity(tree) == SimplyPure
387
387
def isPureExpr (tree : Tree )(implicit ctx : Context ) = exprPurity(tree) >= Pure
388
388
def isIdempotentExpr (tree : Tree )(implicit ctx : Context ) = exprPurity(tree) >= Idempotent
389
389
390
390
/** The purity level of this reference.
391
391
* @return
392
- * PurePath if reference is (nonlazy and stable) or to a parameterized function
392
+ * SimplyPure if reference is (nonlazy and stable) or to a parameterized function
393
393
* Idempotent if reference is lazy and stable
394
394
* Impure otherwise
395
395
* @DarkDimius: need to make sure that lazy accessor methods have Lazy and Stable
396
396
* flags set.
397
397
*/
398
398
private def refPurity (tree : Tree )(implicit ctx : Context ): PurityLevel =
399
- if (! tree.tpe.widen.isParameterless) PurePath
399
+ if (! tree.tpe.widen.isParameterless) SimplyPure
400
400
else if (! tree.symbol.isStable) Impure
401
401
else if (tree.symbol.is(Lazy )) Idempotent // TODO add Module flag, sinxce Module vals or not Lazy from the start.
402
- else PurePath
402
+ else SimplyPure
403
403
404
404
def isPureRef (tree : Tree )(implicit ctx : Context ) =
405
- refPurity(tree) == PurePath
405
+ refPurity(tree) == SimplyPure
406
406
def isIdempotentRef (tree : Tree )(implicit ctx : Context ) =
407
407
refPurity(tree) >= Idempotent
408
408
@@ -726,7 +726,7 @@ object TreeInfo {
726
726
def min (that : PurityLevel ) = new PurityLevel (x min that.x)
727
727
}
728
728
729
- val PurePath = new PurityLevel (3 )
729
+ val SimplyPure = new PurityLevel (3 )
730
730
val Pure = new PurityLevel (2 )
731
731
val Idempotent = new PurityLevel (1 )
732
732
val Impure = new PurityLevel (0 )
0 commit comments