diff options
author | Martin Odersky <odersky@gmail.com> | 2008-09-28 07:56:50 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2008-09-28 07:56:50 +0000 |
commit | 184383a519ab637530899ffd446a30c919e4a991 (patch) | |
tree | 9ca2646d5bb8404b17273ec2a55e1ed3ce87663a /src/compiler/scala/tools/nsc/ast/TreeGen.scala | |
parent | e20362771cc395d6894658de101881b7ae6295b4 (diff) | |
download | scala-184383a519ab637530899ffd446a30c919e4a991.tar.gz scala-184383a519ab637530899ffd446a30c919e4a991.tar.bz2 scala-184383a519ab637530899ffd446a30c919e4a991.zip |
Fixed #1263, and some cosmetic changes
Diffstat (limited to 'src/compiler/scala/tools/nsc/ast/TreeGen.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/TreeGen.scala | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/TreeGen.scala b/src/compiler/scala/tools/nsc/ast/TreeGen.scala index 734921eac6..cc9c748d88 100644 --- a/src/compiler/scala/tools/nsc/ast/TreeGen.scala +++ b/src/compiler/scala/tools/nsc/ast/TreeGen.scala @@ -301,6 +301,8 @@ abstract class TreeGen { def mkForwarder(target: Tree, vparamss: List[List[Symbol]]) = (target /: vparamss)((fn, vparams) => Apply(fn, vparams map paramToArg)) + /** Used in situations where you need to access value of an expression several times + */ def evalOnce(expr: Tree, owner: Symbol, unit: CompilationUnit)(within: (() => Tree) => Tree): Tree = if (treeInfo.isPureExpr(expr)) { within(() => expr); |