Skip to content

Commit 3941b59

Browse files
committed
Fix #8540: Add missing inline to args
1 parent d85cb98 commit 3941b59

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/docs/reference/metaprogramming/macros.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ optimize {
671671

672672
```scala
673673
def sum(args: Int*): Int = args.sum
674-
inline def optimize(arg: Int): Int = ${ optimizeExpr('arg) }
674+
inline def optimize(inline arg: Int): Int = ${ optimizeExpr('arg) }
675675
private def optimizeExpr(body: Expr[Int])(using QuoteContext): Expr[Int] = body match {
676676
// Match a call to sum without any arguments
677677
case '{ sum() } => Expr(0)
@@ -717,7 +717,7 @@ This might be used to then perform an implicit search as in:
717717

718718

719719
```scala
720-
inline def (sc: StringContext).showMe(inline args: Any*): String = ${ showMeExpr('sc, 'args) }
720+
inline def (inline sc: StringContext).showMe(inline args: Any*): String = ${ showMeExpr('sc, 'args) }
721721

722722
private def showMeExpr(sc: Expr[StringContext], argsExpr: Expr[Seq[Any]])(using qctx: QuoteContext): Expr[String] = {
723723
argsExpr match {

0 commit comments

Comments
 (0)