Skip to content

Commit b034157

Browse files
authored
Merge pull request #14446 from dotty-staging/cc-doc-page-3
Fix more typos in CC doc page
2 parents af832ba + 2b3540c commit b034157

File tree

1 file changed

+3
-4
lines changed
  • docs/docs/reference/experimental

1 file changed

+3
-4
lines changed

docs/docs/reference/experimental/cc.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ def test(fs: FileSystem): {fs} String -> Unit =
258258
(x: String) => Logger(fs).log(x)
259259
```
260260
Here, the body of `test` is a lambda that refers to the capability `fs`, which means that `fs` is retained in the lambda.
261-
Consequently, the type of the lambda is `{fs} String => Unit`.
261+
Consequently, the type of the lambda is `{fs} String -> Unit`.
262262

263263
**Note:** Function values are always written with `=>` (or `?=>` for context functions). There is no syntactic
264264
distinction for pure _vs_ impure function values. The distinction is only made in their types.
@@ -271,8 +271,7 @@ def test(fs: FileSystem) =
271271
def g() = (x: String) => Logger(fs).log(x)
272272
f
273273
```
274-
the result of `test` has type `{fs} String => Unit` even though function `f`
275-
itself does not refer to `fs`.
274+
the result of `test` has type `{fs} String -> Unit` even though function `f` itself does not refer to `fs`.
276275

277276
## Capture Checking of Classes
278277

@@ -438,7 +437,7 @@ is OK. But at the point of use, it is `*` (because `f` is no longer in scope), w
438437

439438
Looking at object graphs, we observe a monotonicity property: The capture set of an object `x` covers the capture sets of all objects reachable through `x`. This property is reflected in the type system by the following _monotonicity rule_:
440439

441-
- In a class `C` with a field `f`, the capture set `{this}` covers the capture set `{this.f}` as well as any application of the latter set to pure arguments.
440+
- In a class `C` with a field `f`, the capture set `{this}` covers the capture set `{this.f}` as well as the capture set of any application of `this.f` to pure arguments.
442441

443442
## Checked Exceptions
444443

0 commit comments

Comments
 (0)