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

Drop @capability annotations #20396

Merged
merged 10 commits into from
Jun 4, 2024
Merged

Commits on May 27, 2024

  1. Distinguish maximal from root capabilities

    A maximal capability is one that derives from `caps.Cap`.
    
    Also: drop the given caps.Cap. It's not clear why there needs to be a given for it.
    odersky committed May 27, 2024
    Configuration menu
    Copy the full SHA
    0268185 View commit details
    Browse the repository at this point in the history
  2. Handle tracked class parameters

    The current handling of class type refinements is unsound. We cannot simply
    use a variable for the capture set of a class argument. What we need to do
    instead is treat class arguments as tracked.
    
    In this commit we at least allow explicitly declared tracked arguments. This needed
    two modifications:
    
     - Don't additionally add a capture set for tracked arguments
     - Handle the case where a capture reference is of a singleton type which
       is another capture reference.
    
    As a next step we should treat all class arguments as implicitly tracked.
    odersky committed May 27, 2024
    Configuration menu
    Copy the full SHA
    0c1394f View commit details
    Browse the repository at this point in the history
  3. Drop @capability annotations

    Replace with references that inherit trait `Capability`.
    odersky committed May 27, 2024
    Configuration menu
    Copy the full SHA
    b76bc3e View commit details
    Browse the repository at this point in the history
  4. Drop convention on classes inheriting from universal capturing types

    Drop convention that classes inheriting from universal capturing types are capability classes. Capture sets of parents
    are instead ignored.
    
    The convention led to algebraic anomalies. For instance if
    
        class C extends A => B, Serializable
    
    then C <: (A => B) & Serializable, which has an empty capture set. Yet we treat every occurrence of C as
    implicitly carrying `cap`.
    odersky committed May 27, 2024
    Configuration menu
    Copy the full SHA
    6baff2d View commit details
    Browse the repository at this point in the history
  5. Add fewer parameter refinements.

    Only enrich classes with capture refinements for a parameter if the deep capture set of the parameter's type is nonempty.
    odersky committed May 27, 2024
    Configuration menu
    Copy the full SHA
    08557a1 View commit details
    Browse the repository at this point in the history
  6. Drop ResetPrivate flag

    odersky committed May 27, 2024
    Configuration menu
    Copy the full SHA
    f02b5fb View commit details
    Browse the repository at this point in the history
  7. Turn nested environment capture sets into constants at the end of box…

    … adaptation
    
    This change lets more ref trees with underlying function types keep their singleton
    types.
    odersky committed May 27, 2024
    Configuration menu
    Copy the full SHA
    0177576 View commit details
    Browse the repository at this point in the history
  8. Two fixes to make tests pass as before

     - Avoid creating capture sets of untrackable references
     - Refine disallowRootCapability to consider only explicit captures
    odersky committed May 27, 2024
    Configuration menu
    Copy the full SHA
    4487eeb View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    999be5e View commit details
    Browse the repository at this point in the history
  10. Make capture sets of expressions deriving Capability explicit

    When an expression has a type that derives from caps.Capability, add an
    explicit capture set.
    
    Also: Address other review comments
    odersky committed May 27, 2024
    Configuration menu
    Copy the full SHA
    81cf8d8 View commit details
    Browse the repository at this point in the history