File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
docs/docs/reference/metaprogramming Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -626,8 +626,8 @@ In `scala.quoted.matching` contains object that can help extract values from `Ex
626626
627627These could be used in the following way to optimize any call to ` sum ` that has statically known values.
628628``` scala
629- inline def sum (args : => Int * ): Int = $ { sumExpr(' args ) }
630- private def sumExpr (argsExpr : Expr [Seq [Int ]])(using QuoteContext ): Expr [Int ] = argsExpr.underlyingArgument match {
629+ inline def sum (inline args : Int * ): Int = $ { sumExpr(' args ) }
630+ private def sumExpr (argsExpr : Expr [Seq [Int ]])(using QuoteContext ): Expr [Int ] = argsExpr match {
631631 case ConstSeq (args) => // args is of type Seq[Int]
632632 Expr (args.sum) // precompute result of sum
633633 case ExprSeq (argExprs) => // argExprs is of type Seq[Expr[Int]]
@@ -705,7 +705,7 @@ This might be used to then perform an implicit search as in:
705705
706706
707707``` scala
708- inline def (sc : StringContext ).showMe(args : => Any * ): String = $ { showMeExpr(' sc , ' args ) }
708+ inline def (sc : StringContext ).showMe(inline args : Any * ): String = $ { showMeExpr(' sc , ' args ) }
709709
710710private def showMeExpr (sc : Expr [StringContext ], argsExpr : Expr [Seq [Any ]])(using qctx : QuoteContext ): Expr [String ] = {
711711 argsExpr match {
You can’t perform that action at this time.
0 commit comments