Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes in preparation to make caps.Capability stable #22849

Merged
merged 11 commits into from
Mar 24, 2025

Conversation

natsukagami
Copy link
Contributor

@natsukagami natsukagami commented Mar 20, 2025

  • Make caps a package with non-experimental Capability trait, add caps.internal.

    The following are still under scala.caps, while staying @experimental:

    • The universal capture reference cap -- now an object.
    • The carrier trait for capture set parameters CapSet
    • The Contains trait:
      • Due to givens cannot be marked @experimental, an experimental Contains object was created instead, which contains
        the containsImpl given.
    • Deprecated aliases * and Cap removed
    • Exclusive capabilities annotations: Mutable, SharedCapability and consume
    • The Exists trait: ideally this should go into internal, but I could not get the non-bootstrapped compiler to compile afterwards
    • The unsafe object

    The following are moved under the experimental scala.caps.internal object:

    • capsOf
    • rootCapability, reachCapability and readOnlyCapability
    • refineOverride

    untrackedCaptures is moved into caps.unsafe.

  • Add documentation for Capability and some other experimental annotations

  • Tests are updated accordingly. Note that for some reason error messages are using the scala.caps prefix rather than caps.

…internal

The following are still under `scala.caps`, while staying `@experimental`:
- The universal capture reference `cap`
- The carrier trait for capture set parameters `CapSet`
- The `Contains` trait and the `use` annotation
- Deprecated aliases `*` and `Cap`
- Exclusive capabilities annotations: `Mutable`, `SharedCapability` and `consume`
- The _`Exists`_ trait: ideally this should go into `internal`, but I could not get the non-bootstrapped compiler to compile afterwards
- The `unsafe` object

The following are moved under the experimental `scala.caps.internal` object:
- `containsImpl`
- `capsOf`
- `rootCapability`, `reachCapability` and `readOnlyCapability`
- `untrackedCaptures` and `refineOverride`
For some reason the errors use the `scala.caps` prefix instead of just `caps`. Might need to look into?
@natsukagami natsukagami marked this pull request as ready for review March 20, 2025 19:35
@natsukagami natsukagami requested a review from odersky March 20, 2025 19:36
sjrd
sjrd previously requested changes Mar 20, 2025
@natsukagami natsukagami changed the title Changes to make caps.Capability stable Changes in preparation to make caps.Capability stable Mar 21, 2025
@sjrd sjrd dismissed their stale review March 21, 2025 12:27

Addressed.

@natsukagami natsukagami merged commit f177289 into scala:main Mar 24, 2025
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants