Skip to content

Fix typos on tasty reflect doc #5570

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 5, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/docs/reference/tasty-reflect.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def natConstImpl(x: Expr[Int])(implicit reflection: Reflection): Expr[Int] = {
}
```

`import reflection._` will provide a `unseal` extension method on `quoted.Expr` and `quoted.Type` which return a `reflection.Term` and `reflection.TypeTree` respectively.
`import reflection._` will provide an `unseal` extension method on `quoted.Expr` and `quoted.Type` which returns a `reflection.Term` and `reflection.TypeTree` respectively.
It will also import all extractors and methods on TASTy Reflect trees. For example the `Term.Literal(_)` extractor used below.

```scala
Expand All @@ -52,7 +52,7 @@ def natConstImpl(x: Expr[Int])(implicit reflection: Reflection): Expr[Int] = {

To easily know which extractors are needed, the `reflection.Term.show` method returns the string representation of the extractors.

The method `reflection.Term.reify[T]` provides a way to to go back to a `quoted.Expr`.
The method `reflection.Term.reify[T]` provides a way to go back to a `quoted.Expr`.
Note that the type must be set explicitly and that if it does not conform to it an exception will be thrown.
In the code above we could have replaced `n.toExpr` by `xTree.reify[Int]`.

Expand Down