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

Alternative scheme for cc encapsulation #18899

Merged
merged 21 commits into from
Nov 17, 2023
Merged

Commits on Nov 14, 2023

  1. Configuration menu
    Copy the full SHA
    f7c9595 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    648665d View commit details
    Browse the repository at this point in the history
  3. Note problem with variant.

    odersky committed Nov 14, 2023
    Configuration menu
    Copy the full SHA
    d1290f1 View commit details
    Browse the repository at this point in the history
  4. Return to sealed.

    odersky committed Nov 14, 2023
    Configuration menu
    Copy the full SHA
    a17d8f4 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    b58ae96 View commit details
    Browse the repository at this point in the history
  6. Add reach capabilities

    This adds reach capabilities x* as described in the proposal.
    odersky committed Nov 14, 2023
    Configuration menu
    Copy the full SHA
    beffc7e View commit details
    Browse the repository at this point in the history
  7. Drop local roots in tests

    odersky committed Nov 14, 2023
    Configuration menu
    Copy the full SHA
    484e3e8 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    f72c941 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    2546ade View commit details
    Browse the repository at this point in the history
  10. Drop treatment of local roots

    odersky committed Nov 14, 2023
    Configuration menu
    Copy the full SHA
    da4d512 View commit details
    Browse the repository at this point in the history
  11. Require cap to be imported from caps.

    Since it is never necessary to write `cap` explicitly, there's no need to treat the
    identifier as a soft keyword.
    odersky committed Nov 14, 2023
    Configuration menu
    Copy the full SHA
    927dec1 View commit details
    Browse the repository at this point in the history
  12. Treat all type parameters and abstract types as sealed

    This means that no type parameter can be instantiated with a type that
    captures cap covariantly or invariantly in its type.
    
    Two exceptions/special cases:
    
     - Type arguments for isInstanceOf and asInstanceOf are excluded, they can capture cap
       anywhere.
     - Refining variables in class types can still contain cap since they describe what
       comes from the constructor.
    
    Test reclassifications:
    
     - i15922.scala was moved to pending. Not clear whether this should compile, and what changes would be necessary to get it there.
     - future-traverse.scala was moved to pending. Not clear how to make this compiler.
     - i15749a.scala was moved to neg. The issue description seems to indicate that the test should not compile, but I am not sure what the outcome should be.
    odersky committed Nov 14, 2023
    Configuration menu
    Copy the full SHA
    c1fc2c7 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    e038b78 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    2fc6005 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    d8f17a1 View commit details
    Browse the repository at this point in the history
  16. Make Any.$reach a method.

    For some reason, http4s in the CB fails compilation otherwise.
    It's not clear what the failure has to do with the addition of
    $reach to Any, but it goes away when $reach has Method flag.
    odersky committed Nov 14, 2023
    Configuration menu
    Copy the full SHA
    6ac0439 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    61a55d3 View commit details
    Browse the repository at this point in the history

Commits on Nov 15, 2023

  1. Make $reach a SyntehticArtifact

    That way it does not show up in completion suggestions
    odersky committed Nov 15, 2023
    Configuration menu
    Copy the full SHA
    b176eca View commit details
    Browse the repository at this point in the history
  2. Streamline treatment of CaptureRefs

     - use isTrackableRef everywhere for discrimination (instead of
       just checking the CaptureRef type)
     - streamline treatment of reach refs through `stripReach`
    odersky committed Nov 15, 2023
    Configuration menu
    Copy the full SHA
    f6d7a91 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6e4cd60 View commit details
    Browse the repository at this point in the history

Commits on Nov 16, 2023

  1. Re-classify tests

    - For i15922, it should not work, as both bad1 and bad2 leak scoped
    capabilities. It is moved to neg tests.
    - For future-traverse.scala, we could make it work this way. Previously it won't
    compile because we instantiated the type parameter of `successful` with a
    universal capability, but actually we needn't do that: we could well pick a
    local reach capability, as is done in this commit.
    - For i15749a.scala, it should work but sadly not right now, due to a limitation
    of our current implementation.
    Linyxus committed Nov 16, 2023
    Configuration menu
    Copy the full SHA
    032fe8a View commit details
    Browse the repository at this point in the history