Skip to content

Avoid warning about deprecated enum case at definition #10247

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

Closed
bishabosha opened this issue Nov 9, 2020 · 2 comments
Closed

Avoid warning about deprecated enum case at definition #10247

bishabosha opened this issue Nov 9, 2020 · 2 comments
Assignees

Comments

@bishabosha
Copy link
Member

bishabosha commented Nov 9, 2020

Minimized code

enum Color { @deprecated("no Red", "0.1") case Red }

Output

-- Deprecation Warning: Color.scala:1:13 ---------------------------------------
1 |enum Color { @deprecated("no Red", "0.1") case Red }
  |             ^
  |             value Red in object Color is deprecated since 0.1: no Red
1 warning found

Expectation

I expect the warning only on usages outside of the enum

@bishabosha
Copy link
Member Author

my proposal for now is to use @nowarn("cat=deprecation") to $values and valueOf when support is added.

@bishabosha
Copy link
Member Author

or to add usage within a synthetic definition as another exception to emitting deprecated warning

bishabosha added a commit to dotty-staging/dotty that referenced this issue Jan 4, 2021
bishabosha added a commit to dotty-staging/dotty that referenced this issue Jan 7, 2021
bishabosha added a commit to dotty-staging/dotty that referenced this issue Jan 7, 2021
bishabosha added a commit that referenced this issue Jan 7, 2021
 fix #10247: do not warn deprecated enum cases at declaration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant