Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

lrytz
Copy link
Member

@lrytz lrytz commented Sep 9, 2025

Some of the backports, like -Xsource-features:case-apply-copy-access, are useful even for projects that are on Scala 2 for the time being.

We don't need to force them to use -Xsource:3 and deal with these new warnings.

Some of the backports, like `-Xsource-features:case-apply-copy-access`,
are useful even for projects that are on Scala 2 for the time being.

We don't need to force them to use `-Xsource:3` and deal with these
new warnings.
@lrytz lrytz requested a review from som-snytt September 9, 2025 10:51
@scala-jenkins scala-jenkins added this to the 2.13.17 milestone Sep 9, 2025
Copy link
Contributor

@som-snytt som-snytt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At a high level (a high moral level), this turns migration options into forking options. If you make it easier for them not to upgrade, then they'll never pay the upgrade fee! Or is this a clever plan to keep them paying for consultation on old versions?

The idiom of having everything behind efficient flag currentRun.isScala3, to avoid incurring unnecessary cycles, is maybe overblown.

The other question is whether there are feature interactions, but we would have noticed by now; I don't know if many projects do cherry-pick these or which actually cause problems (I imagine inference options).

I see the changes to boolean exprs factor out the feature flag; I recall that some of those conditions needed "fine tuning", probably a test would break if the condition is wrong; I did proofread for correct number of r's in words such as inferring and overridden.

@lrytz
Copy link
Member Author

lrytz commented Sep 9, 2025

Thanks for thinking this through.

@SethTisue what do you think?

@SethTisue SethTisue added the release-notes worth highlighting in next release notes label Sep 9, 2025
@SethTisue
Copy link
Member

I lean mildly against merging this, on the grounds that (as Som has already said in different words) it grows the matrix of possible flag combinations that we have to support, and for relatively little gain

but I do really mean the "mildly"

@som-snytt
Copy link
Contributor

@SethTisue is nothing if not mild. I think a neutral opinion is in favor of the contributor, who must have reasons, unless @lrytz changes his mind.

It occurs to me to wonder if a build might be configured with the source features, but there is no effect until source 3. Who would do that? Oh, maybe features in common settings, but only certain subprojects are migrating.

I wonder if the plugin formerly known as tpolecat has an opinion about these settings.

@lrytz
Copy link
Member Author

lrytz commented Sep 10, 2025

Yeah, it's case-apply-copy-access in particular that we want to enable. It is doable with -Xsource:3 and silencing all the warnings, but that seemed a bit weird (needed 14 -Wconfs). The codebase is not (yet) on the path to Scala 3.

@som-snytt
Copy link
Contributor

Maybe just add an alias -Ycase-apply-copy-access, which preserves the status quo and acknowledges that, in the context of not migrating, it's just a forking option that changes semantics of a language feature. I'm too lazy to check if other source features are also candidates; I wouldn't propose -Ysource-features that aliases them all, or why not.

@lrytz
Copy link
Member Author

lrytz commented Sep 10, 2025

As a middle ground, I could leave in the Conflicting compiler settings were detected warning which says -Xsource-features requires -Xsource:3. It can be silenced with -Wconf.

@som-snytt
Copy link
Contributor

Normal people use -Xsource:3 when they want a Scala 3 feature for migration, but you can go ahead and use -Wconf to silence this warning and we won't tell anyone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes worth highlighting in next release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants