Skip to content

Commit db3ab9e

Browse files
Merge pull request #6690 from stevenheidel/patch-1
Correct small typo in macros example
2 parents 74d7c89 + d350975 commit db3ab9e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/docs/reference/metaprogramming/macros.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ tree machinery:
279279
delegate for Liftable[Int] {
280280
def toExpr(n: Int): Expr[Int] = n match {
281281
case Int.MinValue => '{ Int.MinValue }
282-
case _ if n < 0 => '{ - ${ toExpr(n) } }
282+
case _ if n < 0 => '{ - ${ toExpr(-n) } }
283283
case 0 => '{ 0 }
284284
case _ if n % 2 == 0 => '{ ${ toExpr(n / 2) } * 2 }
285285
case _ => '{ ${ toExpr(n / 2) } * 2 + 1 }
@@ -586,4 +586,4 @@ val a: Int = defaultOf("int")
586586
val b: String = defaultOf("string")
587587
```
588588

589-
[More details](./macros-spec.html)
589+
[More details](./macros-spec.html)

0 commit comments

Comments
 (0)