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

Skip to content

Conversation

som-snytt
Copy link
Contributor

Improve message for clarity.

Fix bug where warning for apply is emitted too early, as the method may be "retracted" on completion if user-supplied.

Split from #10551

Fixes scala/bug#12883

@scala-jenkins scala-jenkins added this to the 2.13.13 milestone Oct 10, 2023
@som-snytt

This comment was marked as resolved.

@SethTisue SethTisue added the prio:hi high priority (used only by core team, only near release time) label Oct 12, 2023
@SethTisue

This comment was marked as resolved.

@som-snytt som-snytt marked this pull request as ready for review October 12, 2023 14:36
@som-snytt som-snytt force-pushed the issue/12883-apply-warning-bug branch from a76a7d1 to 5e941aa Compare October 16, 2023 23:47
@som-snytt
Copy link
Contributor Author

🎃 (squash)

@som-snytt som-snytt force-pushed the issue/12883-apply-warning-bug branch from 5e941aa to 3f79c85 Compare November 7, 2023 05:32
@som-snytt som-snytt changed the title Don't warn about synthetic apply if user-added [ci: last-only] Don't warn about synthetic apply if user-added Nov 7, 2023
@som-snytt som-snytt requested a review from lrytz November 7, 2023 05:34
@som-snytt
Copy link
Contributor Author

🦃 (rebased)

@lrytz
Copy link
Member

lrytz commented Nov 7, 2023

The implementation looks good, thanks!

I'm still unsure about issuing a warning that cannot be addressed with a code change. case class C private (val x: Int) is fine code in Scala 3, we should not warn about it under -Xsource:3.

@som-snytt
Copy link
Contributor Author

som-snytt commented Nov 7, 2023

I will contribute distinguishing -Xsource:3 (to warn but no behavior changes) and -Xsource:3-X (any version that compares > 3.0, to mean give me behavior change but then don't warn about it).

I see a commit, but I will have to organize a PR. It got mixed in with trying out -Xsource:3 on stdlib.

som-snytt@df45ed0

I think you can approve this as addressing the immediate issue, and I will follow up for the separate issue about nuanced -Xsource:3.

@lrytz
Copy link
Member

lrytz commented Nov 8, 2023

Sounds good to me, thanks!

@lrytz lrytz merged commit f927b4c into scala:2.13.x Nov 8, 2023
@som-snytt som-snytt deleted the issue/12883-apply-warning-bug branch November 8, 2023 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
prio:hi high priority (used only by core team, only near release time)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scala 2.13.12 fatal warning with -Xsource:3 and private constructor for case class
4 participants