Skip to content

Commit 2da015b

Browse files
committed
Fix a code example evalExpr in macros.md
1 parent 48af933 commit 2da015b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/docs/reference/metaprogramming/macros.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,7 @@ private def evalExpr(e: Expr[Int])(using Quotes): Expr[Int] = {
800800
e match {
801801
case '{ val y: Int = $x; $body(y): Int } =>
802802
// body: Expr[Int => Int] where the argument represents references to y
803-
evalExpr(Expr.betaReduce(body)(evalExpr(x)))
803+
evalExpr(Expr.betaReduce('{$body(${evalExpr(x)})}))
804804
case '{ ($x: Int) * ($y: Int) } =>
805805
(x.value, y.value) match
806806
case (Some(a), Some(b)) => Expr(a * b)

0 commit comments

Comments
 (0)