Skip to content

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
@WojciechMazur WojciechMazur added the backport:accepted This PR needs to be backported, once it's been backported replace this tag by "backport:done" label Apr 10, 2025
WojciechMazur added a commit that referenced this pull request Apr 10, 2025
Make `scala.caps` a package instead of an object. 

The following are still under `scala.caps`, while staying `@experimental`:
- The Capability trait, which will be stable in near future
- The universal capture reference `cap` -- **now an object**. 
- The carrier trait for capture set parameters `CapSet`
- The `Contains` trait:
  - Due to `given`s cannot be marked `@experimental`, an experimental `Contains` object was created instead, which contains the `containsImpl` given.
- Exclusive capabilities annotations: `Mutable`, `SharedCapability` and `consume`
- The _`Exists`_ trait is marked `deprecated`, but is required to build the current version of the compiler. It should be removed in the next version.
- The `unsafe` object:
  -  `untrackedCaptures` is moved into `caps.unsafe`.
- Deprecated aliases `*` and `Cap` are **removed**

The following are moved under the experimental `scala.caps.internal` object:
- `capsOf`
- `rootCapability`, `reachCapability` and `readOnlyCapability`
- `refineOverride`

Add documentation for `Capability` and some other experimental annotations.
Tests are updated accordingly. 
[Cherry-picked f177289][modified]
WojciechMazur pushed a commit that referenced this pull request Apr 10, 2025
Make `scala.caps` a package instead of an object. 

The following are still under `scala.caps`, while staying `@experimental`:
- The Capability trait, which will be stable in near future
- The universal capture reference `cap` -- **now an object**. 
- The carrier trait for capture set parameters `CapSet`
- The `Contains` trait:
  - Due to `given`s cannot be marked `@experimental`, an experimental `Contains` object was created instead, which contains the `containsImpl` given.
- Exclusive capabilities annotations: `Mutable`, `SharedCapability` and `consume`
- The _`Exists`_ trait is marked `deprecated`, but is required to build the current version of the compiler. It should be removed in the next version.
- The `unsafe` object:
  -  `untrackedCaptures` is moved into `caps.unsafe`.
- Deprecated aliases `*` and `Cap` are **removed**

The following are moved under the experimental `scala.caps.internal` object:
- `capsOf`
- `rootCapability`, `reachCapability` and `readOnlyCapability`
- `refineOverride`

Add documentation for `Capability` and some other experimental annotations.
Tests are updated accordingly. 
[Cherry-picked f177289]
natsukagami added a commit to natsukagami/dotty that referenced this pull request Apr 10, 2025
Make `scala.caps` a package instead of an object.

The following are still under `scala.caps`, while staying `@experimental`:
- The Capability trait, which will be stable in near future
- The universal capture reference `cap` -- **now an object**.
- The carrier trait for capture set parameters `CapSet`
- The `Contains` trait:
  - Due to `given`s cannot be marked `@experimental`, an experimental `Contains` object was created instead, which contains the `containsImpl` given.
- Exclusive capabilities annotations: `Mutable`, `SharedCapability` and `consume`
- The _`Exists`_ trait is marked `deprecated`, but is required to build the current version of the compiler. It should be removed in the next version.
- The `unsafe` object:
  -  `untrackedCaptures` is moved into `caps.unsafe`.
- Deprecated aliases `*` and `Cap` are **removed**

The following are moved under the experimental `scala.caps.internal` object:
- `capsOf`
- `rootCapability`, `reachCapability` and `readOnlyCapability`
- `refineOverride`

Add documentation for `Capability` and some other experimental annotations.
Tests are updated accordingly.
natsukagami added a commit to natsukagami/dotty that referenced this pull request Apr 10, 2025
Make `scala.caps` a package instead of an object.

The following are still under `scala.caps`, while staying `@experimental`:
- The Capability trait, which will be stable in near future
- The universal capture reference `cap` -- **now an object**.
- The carrier trait for capture set parameters `CapSet`
- The `Contains` trait:
  - Due to `given`s cannot be marked `@experimental`, an experimental `Contains` object was created instead, which contains the `containsImpl` given.
- Exclusive capabilities annotations: `Mutable`, `SharedCapability` and `consume`
- The _`Exists`_ trait is marked `deprecated`, but is required to build the current version of the compiler. It should be removed in the next version.
- The `unsafe` object:
  -  `untrackedCaptures` is moved into `caps.unsafe`.
- Deprecated aliases `*` and `Cap` are **removed**

The following are moved under the experimental `scala.caps.internal` object:
- `capsOf`
- `rootCapability`, `reachCapability` and `readOnlyCapability`
- `refineOverride`

Add documentation for `Capability` and some other experimental annotations.
Tests are updated accordingly.
WojciechMazur added a commit that referenced this pull request Apr 11, 2025
@WojciechMazur WojciechMazur modified the milestones: 3.7.1, 3.7.0 May 1, 2025
@WojciechMazur WojciechMazur added backport:done This PR was successfully backported. and removed backport:accepted This PR needs to be backported, once it's been backported replace this tag by "backport:done" labels May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:done This PR was successfully backported.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants