docs/_docs/reference/experimental/capture-checking/how-to-use.md
Use Scala 3 nightly for the latest features and fixes.
Add this import in any file that uses capture checking:
import language.experimental.captureChecking
Requires the import above:
import language.experimental.captureChecking
import language.experimental.separationChecking
Alternatively, you can clone a pre-defined SBT project to get started: https://github.com/lampepfl/scala3-cc-template
Using the command line through explicit parameters:
scala -S 3.nightly -language:experimental.captureChecking
or when reading from a file:
// foo.scala:
//> using scala 3.nightly
import language.experimental.captureChecking
...
Then, it suffices to run
scala foo.scala
Scaladoc supports capture checking. The nightly standard library API docs have it enabled by default: https://nightly.scala-lang.org/api/
The following options are relevant for capture checking.