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
At present, capture checking is still highly experimental and unstable, and it evolves quickly.
16
16
Before trying it out, make sure you have the latest version of Scala.
17
17
18
-
The rest of this page explains the basics capture checking. Further topics are described in the following pages:
18
+
The rest of this page explains the basics of capture checking. Further topics are described in the following pages:
19
19
20
20
-[Capture Checking of Classes](./classes.md)
21
21
-[Capability Polymorphism](./polymorphism.md)
@@ -90,7 +90,7 @@ try-with-resources patterns, it can also be a key part to the solutions of many
90
90
- How to address the problem of effect polymorphism in general.
91
91
- How to solve the "what color is your function?" problem of mixing synchronous
92
92
and asynchronous computations.
93
-
- How to do region-based allocation, safely,
93
+
- How to do region-based allocation, safely.
94
94
- How to reason about capabilities associated with memory locations.
95
95
96
96
The following sections explain in detail how capture checking works in Scala 3.
@@ -194,8 +194,8 @@ analogous _subcapturing_ relation applies to capture sets. If `C₁` and `C₂`
194
194
195
195
Subtyping extends as follows to capturing types:
196
196
197
-
- Pure types are subtypes of capturing types. That is, `T <: C T`, for any type `T`, capturing set `C`.
198
-
- For capturing types, smaller capturing sets produce subtypes: `C₁ T₁ <: C₂ T₂` if
197
+
- Pure types are subtypes of capturing types. That is, `T <: T ^ C`, for any type `T`, capturing set `C`.
198
+
- For capturing types, smaller capturing sets produce subtypes: `T₁ ^ C₁ <: T₂ ^ C₂` if
199
199
`C₁ <: C₂` and `T₁ <: T₂`.
200
200
201
201
A subcapturing relation `C₁ <: C₂` holds if `C₂`_accounts for_ every element `c` in `C₁`. This means one of the following three conditions must be true:
0 commit comments