Skip to content

Backport "Discourage default arg for extension receiver" to 3.3 LTS #256

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

Merged
merged 2 commits into from
Apr 23, 2025

Conversation

tgodzik
Copy link

@tgodzik tgodzik commented Apr 22, 2025

Backports scala#22492 to the 3.3.7.

PR submitted by the release tooling.
[skip ci]

som-snytt and others added 2 commits April 22, 2025 19:26
Fixes scala#12460

I shied away from making it an error, as that is a language change that
violates the rule that extension methods are ordinary methods. There are
other restrictions, but an extension always allows explicit invocation
`m()(x)` that could leverage a default.

The caret is wrong on the second test case (~todo~). Edit: span of
default getter was union of first parameter and the param RHS, so that
the synthetic position of the getter symbol was a point at the first
parameter. Now the getter tree gets the span of the RHS. (That span is
non-synthetic, but the definition is still synthetic. The name pos of a
synthetic is the point.)
Fixes scala#12460 

I shied away from making it an error, as that is a language change that
violates the rule that extension methods are ordinary methods. There are
other restrictions, but an extension always allows explicit invocation
`m()(x)` that could leverage a default.

The caret is wrong on the second test case (~todo~). Edit: span of
default getter was union of first parameter and the param RHS, so that
the synthetic position of the getter symbol was a point at the first
parameter. Now the getter tree gets the span of the RHS. (That span is
non-synthetic, but the definition is still synthetic. The name pos of a
synthetic is the point.)
[Cherry-picked afb4806][modified]
@tgodzik
Copy link
Author

tgodzik commented Apr 23, 2025

No regressions detected in the community build up to backport-lts-3.3-21744.

Reference

@tgodzik tgodzik merged commit f50e66a into lts-3.3 Apr 23, 2025
22 checks passed
@tgodzik tgodzik deleted the backport-lts-3.3-22492 branch April 23, 2025 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants