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/scaladoc.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
@@ -84,7 +84,7 @@ In case of any discrepancies rely on the source files instead.
84
84
the names of directories containing corresponding TASTY files
85
85
and the kinds of signatures from source files (corresponding to keywords used to declare them like `def`, `class`, `object` etc.)
86
86
whose presence in the generated documentation will be checked (other signatures, when missing, will be ignored).
87
-
The mentioned source files should be located directly inside [](../scaladoc-testcases/src/tests) directory
87
+
The mentioned source files should be located directly inside the [scaladoc-testcases](https://github.com/scala/scala3/tree/main/scaladoc-testcases) directory
88
88
but the file names passed as parameters should contain neither this path prefix nor `.scala` suffix.
89
89
90
90
By default it's expected that all signatures from the source files will be present in the documentation
Copy file name to clipboardExpand all lines: docs/_docs/reference/experimental/capture-checking/classes.md
+35-2Lines changed: 35 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -77,9 +77,10 @@ we know that the type of `this` must be pure, since `this` is the right hand sid
77
77
78
78
### Traits and Open Classes
79
79
80
-
The self-type inference behaves differently depending on whether all subclasses of a class are known. For a regular (non-open, non-abstract) class, all subclasses are known at compile time, so the capture checker can precisely infer the self-type. However, for traits, abstract classes, and [`open`](../other-new-features/open-classes.md) classes, arbitrary subclasses may exist, so the capture checker conservatively assumes that `this` may capture capabilities.
80
+
The self-type inference behaves differently depending on whether all subclasses of a class are known. For a regular (non-open, non-abstract) class, all subclasses are known at compile time, so the capture checker can precisely infer the self-type. However, for traits, abstract classes, and [`open`](../../other-new-features/open-classes.md) classes, arbitrary subclasses may exist, so the capture checker conservatively assumes that `this` may capture arbitrary capabilities
81
+
(i.e., it infers the universal capture set `cap`).
81
82
82
-
For example:
83
+
For example (assuming all definitions are in the same file):
83
84
```scala
84
85
classA:
85
86
deffn:A=this// ok
@@ -102,6 +103,38 @@ open class E:
102
103
deffn2:E^=this// ok
103
104
```
104
105
106
+
### Inheritance
107
+
108
+
The capture set of `this` of a class or trait also serves as an upper bound of the possible capture
0 commit comments