diff --git a/docs/docs/reference/metaprogramming/macros.md b/docs/docs/reference/metaprogramming/macros.md index 33e1f12e4147..433a2e273135 100644 --- a/docs/docs/reference/metaprogramming/macros.md +++ b/docs/docs/reference/metaprogramming/macros.md @@ -279,7 +279,7 @@ tree machinery: delegate for Liftable[Int] { def toExpr(n: Int): Expr[Int] = n match { case Int.MinValue => '{ Int.MinValue } - case _ if n < 0 => '{ - ${ toExpr(n) } } + case _ if n < 0 => '{ - ${ toExpr(-n) } } case 0 => '{ 0 } case _ if n % 2 == 0 => '{ ${ toExpr(n / 2) } * 2 } case _ => '{ ${ toExpr(n / 2) } * 2 + 1 } @@ -586,4 +586,4 @@ val a: Int = defaultOf("int") val b: String = defaultOf("string") ``` -[More details](./macros-spec.html) \ No newline at end of file +[More details](./macros-spec.html)