Skip to content

Commit 6717023

Browse files
authored
Fix TASTY reflect examples
- `'x` is deprecated symbol syntax, not splicing (yet) - without by-name parameter passing anything else than a constant will not work (`Expr[Int]` will be `Ident(x)`)
1 parent 63aab40 commit 6717023

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/docs/reference/other-new-features/tasty-reflect.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ To provide reflection capabilities in macros we need to add an implicit paramete
2424
import scala.quoted._
2525
import scala.tasty._
2626

27-
inline def natConst(x: Int): Int = ~natConstImpl('x)
27+
inline def natConst(x: => Int): Int = ~natConstImpl('(x))
2828

2929
def natConstImpl(x: Expr[Int])(implicit reflection: Reflection): Expr[Int] = {
3030
import reflection._

0 commit comments

Comments
 (0)