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

Consolidate CC #21863

Open
wants to merge 31 commits into
base: main
Choose a base branch
from
Open

Consolidate CC #21863

wants to merge 31 commits into from

Commits on Oct 30, 2024

  1. Recognize double annotated capabilities such as x*?

    x*? is x.type @reach @maybe. This was not recognized before.
    odersky committed Oct 30, 2024
    Configuration menu
    Copy the full SHA
    5fc498a View commit details
    Browse the repository at this point in the history
  2. Refactor narrowCaps

    odersky committed Oct 30, 2024
    Configuration menu
    Copy the full SHA
    e130c05 View commit details
    Browse the repository at this point in the history
  3. Make sure dcs includes cs

    Previously, we violated that assumption is we too the deep capture set
    of a capture reference wiht singleton type.
    odersky committed Oct 30, 2024
    Configuration menu
    Copy the full SHA
    8516e12 View commit details
    Browse the repository at this point in the history
  4. Align deep capture sets with reach capabilities

    Count in dcs exactly those locations where a cap gets replaced by a reach capability.
    odersky committed Oct 30, 2024
    Configuration menu
    Copy the full SHA
    e1b31c1 View commit details
    Browse the repository at this point in the history
  5. Refactor handling of applications

    Simplify code that handles applications, avoiding adding pieces of mutable state.
    odersky committed Oct 30, 2024
    Configuration menu
    Copy the full SHA
    f6f178b View commit details
    Browse the repository at this point in the history
  6. Handle reach capabilities correctly in markFree

    The correct point to address charging reach capabilities is in markFree itself:
    When a reach capability goes out of scope, and that capability is not a parameter,
    we need to continue with the underlying capture set.
    odersky committed Oct 30, 2024
    Configuration menu
    Copy the full SHA
    913c5bb View commit details
    Browse the repository at this point in the history
  7. Rename @unbox to @use

    odersky committed Oct 30, 2024
    Configuration menu
    Copy the full SHA
    ca0a6f9 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    fc46e5c View commit details
    Browse the repository at this point in the history
  9. Drop curried use scheme

    Drop the scheme where we only charge the last arrow of a curried lambda with
    elements used in the body. On the one hand, this is unsound without compensation
    measures (like, restricting to reach capabilities, or taking all capture sets
    of a named curried function as the underlying reference). On the other hand, this
    should be generalized to all closures and anonymous functions forming the right
    hand sides of methods.
    odersky committed Oct 30, 2024
    Configuration menu
    Copy the full SHA
    70af983 View commit details
    Browse the repository at this point in the history

Commits on Oct 31, 2024

  1. Stop markFree at nested methods

    Use sets of nested methods are anyway charged on call.
    odersky committed Oct 31, 2024
    Configuration menu
    Copy the full SHA
    f54d0fa View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1a781b2 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a90c32a View commit details
    Browse the repository at this point in the history
  4. Re-enable handleEtaExpansionsSpecially setting

    This gives better error messages. Previously we thought this would
    make reach capabilities unsound, but I don't see an issue with the latest
    design.
    odersky committed Oct 31, 2024
    Configuration menu
    Copy the full SHA
    3df2b56 View commit details
    Browse the repository at this point in the history
  5. Disable reach capabilities in nested closures appearing without @use

    With our current @use scheme, this is unsound. We leave the possibility to re-enable
    as a Config option which is disabled by default and comes with a warning that enabling
    it would be unsound.
    odersky committed Oct 31, 2024
    Configuration menu
    Copy the full SHA
    308ab14 View commit details
    Browse the repository at this point in the history

Commits on Nov 1, 2024

  1. Go back to sealed checking

    Check that type parameters of methods and parent traits don't get instantiated
    with types containing a `cap` anywhere in covariant or invariant position.
    odersky committed Nov 1, 2024
    Configuration menu
    Copy the full SHA
    128a2d7 View commit details
    Browse the repository at this point in the history

Commits on Nov 2, 2024

  1. Configuration menu
    Copy the full SHA
    735506b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f5229fd View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    60c0960 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    8c82d37 View commit details
    Browse the repository at this point in the history

Commits on Nov 3, 2024

  1. Fix dcs for invariant type parameters

    Also: add test that reach capabilities are contained inside boxes
    odersky committed Nov 3, 2024
    Configuration menu
    Copy the full SHA
    0c5573a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    571119a View commit details
    Browse the repository at this point in the history

Commits on Nov 5, 2024

  1. Configuration menu
    Copy the full SHA
    ce3c01d View commit details
    Browse the repository at this point in the history
  2. Be more careful computing underlying types of reach capabilities

    We can use the dcs only if there are no type variables.
    odersky committed Nov 5, 2024
    Configuration menu
    Copy the full SHA
    ac06cb5 View commit details
    Browse the repository at this point in the history
  3. Polish code of markFree

    odersky committed Nov 5, 2024
    Configuration menu
    Copy the full SHA
    60f0233 View commit details
    Browse the repository at this point in the history

Commits on Nov 8, 2024

  1. Revert change to Iterator

    The additional purity in the asInstanceOf target is not needed
    odersky committed Nov 8, 2024
    Configuration menu
    Copy the full SHA
    7449641 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    37a8794 View commit details
    Browse the repository at this point in the history
  3. Drop legacy caps.unsafe operations

    Retain only caps.unsafe.unsafeAssumePure
    odersky committed Nov 8, 2024
    Configuration menu
    Copy the full SHA
    986c57d View commit details
    Browse the repository at this point in the history
  4. Don't show redudundant existental wrappers

    Don't show an `(ex$n: Exists) ->` if the bound variable
    does not appear in the result. The full type will be shown under -Ycc-debug.
    
    Also, avoid spurious ineffective mappings in widenReach.
    odersky committed Nov 8, 2024
    Configuration menu
    Copy the full SHA
    40b06a8 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    4c8bd42 View commit details
    Browse the repository at this point in the history

Commits on Nov 11, 2024

  1. Treat by-name closures specially in recheck

    A by-name Closure node, which is produced by phase ElimByName gets a target type to indicate
    it's a contextual zero parameter closure. But for the purposes of rechecking and capture checking,
    it needs to be treated like a function. In particular the type of the closure needs to be derived
    from the result type of the anonymous function.
    
    Fixes scala#21920
    odersky committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    e3c91f3 View commit details
    Browse the repository at this point in the history

Commits on Nov 12, 2024

  1. Configuration menu
    Copy the full SHA
    34972d8 View commit details
    Browse the repository at this point in the history