You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/contributing/debugging.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -88,7 +88,7 @@ But you can also do:
88
88
assertPositioned(tree.reporting(s"Tree is: $result"))
89
89
```
90
90
91
-
`def (a: A).reporting(f: WrappedResult[T] ?=> String, p: Printer = Printers.default): A` is defined on all types. The function `f` can be written without the argument since it is a context function`. 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.
91
+
`extension (a: A) def reporting(f: WrappedResult[T] ?=> String, p: Printer = Printers.default): A` is defined on all types. The function `f` can be written without the argument since it is a context function`. 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.
92
92
93
93
##Printing out trees after phases
94
94
To print out the trees you are compiling after the FrontEnd (scanner, parser, namer, typer) phases:
Copy file name to clipboardExpand all lines: docs/docs/reference/dropped-features/package-objects.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ def b = a._2
22
22
caseclassC()
23
23
24
24
implicitobjectCops {
25
-
def (x: C).pair(y: C) = (x, y)
25
+
extension (x: C)defpair(y: C) = (x, y)
26
26
}
27
27
```
28
28
There may be several source files in a package containing such toplevel definitions, and source files can freely mix toplevel value, method, and type definitions with classes and objects.
Copy file name to clipboardExpand all lines: docs/docs/reference/other-new-features/opaques.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,15 +29,15 @@ object Logarithms {
29
29
}
30
30
```
31
31
32
-
This introduces `Logarithm` as a new abstract type, which is implemented as `Double`.
32
+
This introduces `Logarithm` as a new abstract type, which is implemented as `Double`.
33
33
The fact that `Logarithm` is the same as `Double` is only known in the scope where
34
34
`Logarithm` is defined which in the above example corresponds to the object `Logarithms`.
35
-
Or in other words, within the scope it is treated as type alias, but this is opaque to the outside world
35
+
Or in other words, within the scope it is treated as type alias, but this is opaque to the outside world
36
36
where in consequence `Logarithm` is seen as an abstract type and has nothing to do with `Double`.
37
37
38
-
The public API of `Logarithm` consists of the `apply` and `safe` methods defined in the companion object.
38
+
The public API of `Logarithm` consists of the `apply` and `safe` methods defined in the companion object.
39
39
They convert from `Double`s to `Logarithm` values. Moreover, a collective extension `logarithmOps` provides the extension methods `toDouble` that converts the other way,
40
-
and operations `+` and `*` on `Logarithm` values.
40
+
and operations `+` and `*` on `Logarithm` values.
41
41
The following operations would be valid because they use functionality implemented in the `Logarithms` object.
0 commit comments