ScalaPB
ScalaPB copied to clipboard
Add the `asRecognized` to parent trait GeneratedEnum
and document the method in documentation
Hi @thesamet ! Have you had the change to look at this PR yet? :slightly_smiling_face:
Sorry for the delay. I am not comfortable with this proposal since inferred type for users' enum vals is going to become Recognized
rather than EnumName
.
I'm not sure I understand, this PR isn't changing anything about how the types are inferred, it just puts the asRecognized
method to the GeneratedEnum
, which is parent of all enum values.
But if you're concerned about the inferred type, maybe we could rename it from Recognized
to EnumNameRecognized
?
The concern is this:
val x = Seq(Weather.RAIN, Weather.SUNSHINE)
The inferred type of x
would be Seq[Weather.Recognized]
, or Seq[WeatherRecognized]
(if we go with the proposal from the previous comment). This addition would be unnecessary noise for most users.
I think I see what you mean. But I think that has been already fixed in this PR, no? The enum cases now don't inherit only from Recognized
(as was the case when I opened the PR), I reverted this change, so things are back to normal, where enum cases inherit both from the parent sealed trait and Recognized, as before.
I updated the documentation to reflect that.
Closing due to inactivity.
Hello @thesamet , oh how time flies :sweat_smile: This must have slipped my mind.
Would you still be open to merging this if I revived the PR, incorporated the feedback, etc?
Hey @sideeffffect , time flies! If you're still interested, happy to review. Since it's been a while - it would be great if you can file a corresponding issue describing what problem we're here to solve, and what is the proposed solution. Also, is this change breaking in the sense that it would only go on the next release (0.12.x) ?