We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 74d7c89 + d350975 commit db3ab9eCopy full SHA for db3ab9e
docs/docs/reference/metaprogramming/macros.md
@@ -279,7 +279,7 @@ tree machinery:
279
delegate for Liftable[Int] {
280
def toExpr(n: Int): Expr[Int] = n match {
281
case Int.MinValue => '{ Int.MinValue }
282
- case _ if n < 0 => '{ - ${ toExpr(n) } }
+ case _ if n < 0 => '{ - ${ toExpr(-n) } }
283
case 0 => '{ 0 }
284
case _ if n % 2 == 0 => '{ ${ toExpr(n / 2) } * 2 }
285
case _ => '{ ${ toExpr(n / 2) } * 2 + 1 }
@@ -586,4 +586,4 @@ val a: Int = defaultOf("int")
586
val b: String = defaultOf("string")
587
```
588
589
-[More details](./macros-spec.html)
+[More details](./macros-spec.html)
0 commit comments