Skip to content

Conversation

@odersky
Copy link
Contributor

@odersky odersky commented Jan 14, 2026

The deprecated class NonLocalReturns.ReturnThrowable acquired a new base type caps.Control in 3.8. That was a mistake. Later versions of the capture checker reject that inheritance since ReturnThrowable is an exception and therefore must be a pure class, whereas inheriting caps.Control would automatically add a capture set to that class.

It's too late to revert for 3.8, but we should revert for 3.8.1. It's technically a backwards incompatible change, but I would be extremely surprised if anyone has used ReturnThrowable as a caps.Control in the 3.8.0 window.

The deprecated class NonLocalReturns.ReturnThrowable acquired a new base type
`caps.Control` in 3.8. That was a mistake. Later versions of the capture checker
reject that inheritance since `ReturnThrowable` is an exception and therefore
must be a pure class, whereas inheriting `caps.Control` would automatically
add a capture set to that class.

It's too late to revert for 3.8, but we should revert for 3.8.1. It's technically
a backwards incompatible change, but I would be extremely surprised if anyone has
used ReturnThrowable as a caps.Control in the 3.8.0 window.
@odersky odersky requested a review from a team as a code owner January 14, 2026 14:58
@odersky odersky requested review from natsukagami and removed request for a team January 14, 2026 14:58
@odersky odersky added this to the 3.8.1 milestone Jan 14, 2026
@odersky odersky merged commit 8f18230 into scala:main Jan 15, 2026
56 checks passed
@odersky odersky deleted the fix-return-throwable branch January 15, 2026 09:49
@WojciechMazur WojciechMazur added the backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it. label Jan 19, 2026
@WojciechMazur WojciechMazur modified the milestones: 3.8.2, 3.8.1 Jan 20, 2026
@WojciechMazur WojciechMazur added backport:accepted This PR needs to be backported, once it's been backported replace this tag by "backport:done" and removed backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it. labels Jan 20, 2026
WojciechMazur added a commit that referenced this pull request Jan 20, 2026
…8.1 (#25015)

Backports #24975 to the 3.8.1 (hotfix).

PR submitted by the release tooling. 

Would also be backported to 3.8.2-RC2 (successor of 3.8.1-RC1)
@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 Jan 20, 2026
WojciechMazur added a commit that referenced this pull request Jan 22, 2026
…8.2 (#25044)

Backports #24975 to the 3.8.2-RC1.

PR submitted by the release tooling.
[skip ci]
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.

3 participants