Skip to content
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

Deprecation of case class elements #17911

Merged
merged 1 commit into from
Apr 14, 2024

Conversation

som-snytt
Copy link
Contributor

@som-snytt som-snytt commented Jun 6, 2023

Synthetic members of case classes should not incur deprecation warnings when a case element is deprecated.

Fixes #17908

Also when message in Java deprecation is empty, improve

-- Deprecation Warning: ------------------------------------------------------------------------------------------------
1 |f
  |^
  |method f is deprecated since :
val res0: Int = 42

to

-- Deprecation Warning: ------------------------------------------------------------------------------------------------
1 |f
  |^
  |method f is deprecated
val res0: Int = 42

@som-snytt som-snytt force-pushed the issue/17908-case-deprecation branch 3 times, most recently from e23bc4f to 9a85ee9 Compare June 7, 2023 03:38
@som-snytt som-snytt marked this pull request as ready for review June 7, 2023 05:17
@SethTisue
Copy link
Member

(removing Som's assignment to make it show up in the unassigned-PRs roundup)

@hamzaremmal
Copy link
Member

@som-snytt Can you fix the conflict and squash everything in a single commit ?

tests/pos/i11022.scala Outdated Show resolved Hide resolved
@hamzaremmal hamzaremmal assigned som-snytt and unassigned hamzaremmal Mar 4, 2024
@som-snytt som-snytt force-pushed the issue/17908-case-deprecation branch from 9a85ee9 to 1327f1d Compare March 19, 2024 23:00
@som-snytt
Copy link
Contributor Author

It seems to be compensating for missing deprecation of case class C.apply and unapply.

The exclusion for case class is similar to the exclusion for enum, but restricted to synthetics.

@som-snytt som-snytt assigned hamzaremmal and unassigned som-snytt Mar 20, 2024
@hamzaremmal hamzaremmal merged commit 7b336d2 into scala:main Apr 14, 2024
19 checks passed
@som-snytt som-snytt deleted the issue/17908-case-deprecation branch April 14, 2024 13:49
@Kordyjan Kordyjan added this to the 3.5.0 milestone May 10, 2024
WojciechMazur added a commit that referenced this pull request Jul 5, 2024
Backports #17911 to the LTS branch.

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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deprecated case class element warns (twice!) at its definition
4 participants