Skip to content

Commit 13e5e0d

Browse files
committed
Fix typo and move text
1 parent d727a7b commit 13e5e0d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/docs/reference/tasty-reflect.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ You may find all you need without using TASTy Reflect.
1818
Using TASTy Reflect will break these guarantees and may fail at macro expansion time, hence additional explicit check must be done.
1919

2020

21-
To provide reflection capabilities in macro we need to add an implicit parameter of type `scala.tasty.Reflection` and import it in the scope where it is used.
21+
To provide reflection capabilities in macros we need to add an implicit parameter of type `scala.tasty.Reflection` and import it in the scope where it is used.
2222

2323
```scala
2424
import scala.quoted._
@@ -34,8 +34,6 @@ def natConstImpl(x: Expr[Int])(implicit reflection: Reflection): Expr[Int] = {
3434

3535
`import reflection._` will provide a `reflect` extension method on `quoted.Expr` and `quoted.Type` which return a `reflection.Term` and `reflection.TypeTree` respectivly.
3636
It will also import all extractors and methods on TASTy Reflect trees. For example the `Term.Literal(_)` extractor used bellow.
37-
To easily know which extractor are needed the `reflection.Term.show` method returns the string representation of the extractors.
38-
3937

4038
```scala
4139
def natConstImpl(x: Expr[Int])(implicit reflection: Reflection): Expr[Int] = {
@@ -52,6 +50,8 @@ def natConstImpl(x: Expr[Int])(implicit reflection: Reflection): Expr[Int] = {
5250
}
5351
```
5452

53+
To easily know which extractor are needed the `reflection.Term.show` method returns the string representation of the extractors.
54+
5555
The method `reflection.Term.reify[T]` provides a way to to go back to a `quoted.Expr`.
5656
Note that the type must be set explicitly and that if it does not conform to it an exception will be thrown.
5757
In the code above we could have replaced `n.toExpr` by `xTree.reify[Int]`.

0 commit comments

Comments
 (0)