Skip to content

Commit f9320fc

Browse files
macros.md: Documentation does not match example
It looks like the documentation was reflowed at some point, references to `t` are not present in this block, only in subsequent ones. If this is incorrect or if this section should be reflowed, please let me know and I'd be happy to do it.
1 parent 59ea58e commit f9320fc

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
@@ -192,8 +192,8 @@ quote but no splice between the parameter binding of `T` and its
192192
usage. But the code can be rewritten by adding a binding of a `Type[T]` tag:
193193

194194
```scala
195-
def to[T, R](f: Expr[T] => Expr[R])(using Type[T], Type[R], Quotes): Expr[T => R] =
196-
'{ (x: T) => ${ f('x) } }
195+
def to[T, R](f: Expr[T] => Expr[R])(using t: Type[T])(using Type[R], Quotes): Expr[T => R] =
196+
'{ (x: $t) => ${ f('x) } }
197197
```
198198

199199
In this version of `to`, the type of `x` is now the result of

0 commit comments

Comments
 (0)