-
-
Notifications
You must be signed in to change notification settings - Fork 280
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
Unrecognised enum's constructor could be private #1155
Comments
Hi @markosski , thanks for reporting. For messages, we have an |
Annotations would work but a separate option gives more visibility to this feature, don't you think? |
That's the idea. What do you think? Shall I start writing tests? |
Hello,
I'm relatively new to this repo so forgive me if my lack of experience results in wasting your time.
Using the Weather example:
This results that:
The problem is the second one I believe.
Why?:
I almost wrote something like that but then I realized that it wouldn't work so I got curious that others made the same mistake and it turned out: yes.
How?:
As I can see/guess the enum was part of the dependency library but they were in a hurry and just added the not existing enum
This worked at the time it was written. But someone added the enum to the dependency library and published and then later someone updated the version which contains the new enum. That's when things went poo poo.
The
x == Foo.fromValue(42)
should be fine but mistakes happen.AFAIK this could be prevented by making
Unrecognised
private. (For backward compatibility it can be even an option in the config.) (private final case class Unrecognised(...
)What do you think?
The text was updated successfully, but these errors were encountered: