diff --git a/docs/docs/contributing/debugging.md b/docs/docs/contributing/debugging.md index efabcfbd11b1..d031de9cf8a8 100644 --- a/docs/docs/contributing/debugging.md +++ b/docs/docs/contributing/debugging.md @@ -84,10 +84,10 @@ assertPositioned(tree) But you can also do: ```scala -assertPositioned(tree.reporting(t => t.show)) +assertPositioned(tree.reporting(s"Tree is: $result")) ``` -`(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. +`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. ## Printing out trees after phases To print out the trees you are compiling after Frontend (scanner, parser, namer, typer) phase: