Skip to content

Commit bc81953

Browse files
Merge pull request #6943 from dotty-staging/reporting-docs-update
Update `reporting` docs
2 parents 3181374 + d5c8cce commit bc81953

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/docs/contributing/debugging.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ assertPositioned(tree)
8484
But you can also do:
8585

8686
```scala
87-
assertPositioned(tree.reporting(t => t.show))
87+
assertPositioned(tree.reporting(s"Tree is: $result"))
8888
```
8989

90-
`(a: A).reporting(f: A => String): A` is defined on all types. Its job is to print a `String` produced by the argument function and return the value it is called on unchanged.
90+
`def (a: A) reporting(f: given WrappedResult[T] => String, p: Printer = Printers.default): A` is defined on all types. The function `f` can be written without the argument since the argument is `given`. The `result` variable is a part of the `WrapperResult` – a tiny framework powering the `reporting` function. Basically, whenever you are using `reporting` on an object `A`, you can use the `result: A` variable from this function and it will be equal to the object you are calling `reporting` on.
9191

9292
## Printing out trees after phases
9393
To print out the trees you are compiling after Frontend (scanner, parser, namer, typer) phase:

0 commit comments

Comments
 (0)