From d3509750089c494a9c6692a724eed7e19bd06555 Mon Sep 17 00:00:00 2001 From: Steven Heidel Date: Sat, 15 Jun 2019 10:47:19 -0700 Subject: [PATCH] Correct small typo in macros example --- docs/docs/reference/metaprogramming/macros.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)