aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/typer
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2017-02-02 10:27:59 +1100
committerMartin Odersky <odersky@gmail.com>2017-02-02 10:27:59 +1100
commit92ab901869e110a2fe436bca793578d640b9def3 (patch)
tree0f23b8e0aa864a3cfba120ec880f77342d36e6fb /compiler/src/dotty/tools/dotc/typer
parentcca5dd9bd0c8f0d2e5679c81f2c40247a45d7a02 (diff)
downloaddotty-92ab901869e110a2fe436bca793578d640b9def3.tar.gz
dotty-92ab901869e110a2fe436bca793578d640b9def3.tar.bz2
dotty-92ab901869e110a2fe436bca793578d640b9def3.zip
Fix #1569: Fix logic for by-name parameters of inline methods
As #1569 shows, by-name parameters should be treated in the same way as by-value parameters. If the expression is not pure, install a binding.
Diffstat (limited to 'compiler/src/dotty/tools/dotc/typer')
-rw-r--r--compiler/src/dotty/tools/dotc/typer/Inliner.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/src/dotty/tools/dotc/typer/Inliner.scala b/compiler/src/dotty/tools/dotc/typer/Inliner.scala
index 09487570d..cfc0003c6 100644
--- a/compiler/src/dotty/tools/dotc/typer/Inliner.scala
+++ b/compiler/src/dotty/tools/dotc/typer/Inliner.scala
@@ -327,7 +327,7 @@ class Inliner(call: tpd.Tree, rhs: tpd.Tree)(implicit ctx: Context) {
(tp.paramNames, tp.paramTypes, argss.head).zipped.foreach { (name, paramtp, arg) =>
def isByName = paramtp.dealias.isInstanceOf[ExprType]
paramBinding(name) = arg.tpe.stripAnnots.stripTypeVar match {
- case argtpe: SingletonType if isByName || isIdempotentExpr(arg) => argtpe
+ case argtpe: SingletonType if isIdempotentExpr(arg) => argtpe
case argtpe =>
val inlineFlag = if (paramtp.hasAnnotation(defn.InlineParamAnnot)) Inline else EmptyFlags
val (bindingFlags, bindingType) =