Skip to content

Commit 6e6cf79

Browse files
committed
Update 'How to Use the Capture Checker'
1 parent fa3863f commit 6e6cf79

File tree

1 file changed

+42
-1
lines changed

1 file changed

+42
-1
lines changed

docs/_docs/reference/experimental/capture-checking/how-to-use.md

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,48 @@ nightlyOf: https://docs.scala-lang.org/scala3/reference/experimental/capture-che
66

77
## Enabling Capture Checking
88

9-
TODO
9+
Use Scala 3 nightly for the latest features and fixes.
10+
11+
Add this import in any file that uses capture checking:
12+
```scala
13+
import language.experimental.captureChecking
14+
```
15+
16+
### Separation Checking
17+
18+
Requires the import above:
19+
```scala
20+
import language.experimental.captureChecking
21+
import language.experimental.separationChecking
22+
```
23+
24+
### SBT Project Template
25+
26+
Alternatively, you can clone a pre-defined SBT project to get
27+
started: https://github.com/lampepfl/scala3-cc-template
28+
29+
### The REPL/Scala-CLI
30+
31+
Using the command line through explicit parameters:
32+
```bash
33+
scala -S 3.nightly -language:experimental.captureChecking
34+
```
35+
or when reading from a file:
36+
```scala
37+
// foo.scala:
38+
//> using scala 3.nightly
39+
import language.experimental.captureChecking
40+
...
41+
```
42+
Then, it suffices to run
43+
```bash
44+
scala foo.scala
45+
```
46+
47+
## API Documentation
48+
49+
Scaladoc supports capture checking. The nightly standard library API docs have it enabled by default:
50+
https://nightly.scala-lang.org/api/
1051

1152
## Compilation Options
1253

0 commit comments

Comments
 (0)