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

Do not issue deprecation warnings when declaring deprecated case classes #17165

Merged
merged 1 commit into from
May 1, 2023

Conversation

jan-pieter
Copy link
Contributor

@jan-pieter jan-pieter commented Mar 28, 2023

Do trigger a deprecation warning when calling synthetic members of the companion object of a deprecated case class.

Fixes #11022

@jan-pieter jan-pieter changed the title WIP on fixing #11022 Do not issue deprecation warnings when declaring deprecated case classes Mar 29, 2023
@jan-pieter jan-pieter marked this pull request as ready for review April 18, 2023 07:08
Copy link
Contributor

@odersky odersky left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM.

Thanks for the contribution!

def skipWarning(using Context) =
ctx.owner.ownersIterator.exists(if sym.isEnumCase then isDeprecatedOrEnum else _.isDeprecated)
def skipWarning(using Context): Boolean =
(ctx.owner.is(Synthetic) && sym.is(CaseClass)) ||
Copy link
Contributor

Choose a reason for hiding this comment

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

The preferred style is to move || in front of next line.

@SethTisue SethTisue merged commit 1aa3372 into scala:main May 1, 2023
@jan-pieter jan-pieter deleted the fix/11022 branch May 31, 2023 12:11
@Kordyjan Kordyjan added this to the 3.3.1 milestone Aug 1, 2023
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 warns at its definition
4 participants