Fix match type bounds checking problem#23695
Merged
odersky merged 1 commit intoscala:mainfrom Aug 8, 2025
Merged
Conversation
natsukagami
approved these changes
Aug 8, 2025
natsukagami
added a commit
to natsukagami/dotty
that referenced
this pull request
Aug 11, 2025
Relies on scala#23695 to land on next base version
2 tasks
WojciechMazur
added a commit
that referenced
this pull request
Aug 13, 2025
Backports #23695 to the 3.7.3-RC2. PR submitted by the release tooling.
natsukagami
added a commit
to natsukagami/dotty
that referenced
this pull request
Aug 15, 2025
Relies on scala#23695 to land on next base version
hamzaremmal
added a commit
that referenced
this pull request
Aug 16, 2025
<!--
- **Add capture checking to boundary and NonLocalReturns**
- **Add capture-checking test for boundary**
- **Patch DropBreaks to correctly detect boundary blocks**
- **Add capture checking to CommandLineParser**
- **Add capture checking to scala.util**
- **Add capture checking to scala.runtime**
- **Add capture checking to rest of scala.runtime (except
TupledFunctions)**
- **Add capture checking to IArray**
- **[TODO INVESTIGATE] IArray: `Array[AnyRef^{xs*}]` not working, revert
cast**
- **Add capture checking to various scala.* base package files**
- **[TODO FIX] Temporarily drop upper bound of higher-kinded type `F` in
tuple match types**
- **Add capture checking to scala.reflect**
- **[TODO REMOVE] Add TODO list**
- **[TODO EXPLAIN] Add capture checking to Mirror and TupleMirror**
- **Add capture checking to scala.caps**
- **Add capture checking to compiletime.Ops**
- **Add capture checking to stdLibPatches**
- **Add capture checking to annotations**
- **Attempt to capture-check quotes**
- **Track sun.misc.Unsafe in LazyVal implementation**
- **Require Conversion to be pure**
-->
## List of changes
- Capture checking enabled for all files except listed in the next
section
- `boundary` is now capture-checked, preventing `Label` from being
leaked outside of its corresponding `boundary`. Requires #23507.
- `
## Files missing capture checking
- [ ] `Tuple.scala`, waiting for #23695 to reach the next base version
- [ ] `Mirror.scala`, which requires auto-generated Mirrors to be
compatible with extending one of the `caps.Capability` subtraits.
Currently the plan is to simply ban case classes.
---------
Co-authored-by: Hamza Remmal <hamza@remmal.net>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.