-
Notifications
You must be signed in to change notification settings - Fork 1.1k
refactor: change Message kind into an enum instead of a String #14791
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
Conversation
7c76421
to
abd0b2a
Compare
Alternative to relying on
(Trying to recall if that is my first Scala 3 enum.) |
The thing I'm afraid for with this though is that somewhere someone will just rely on the |
Oh, you mean they're used to "kind" being "just a string"? I would not sweat that. But I haven't looked closely at the interpolators for messaging. I hope they don't just toString. I saw Dale's "use show" PR but haven't looked twice yet. Maybe this is the moment when, as smarter would say, it becomes "principled". Others would say "reasonable". |
Alright, I took your suggestion @som-snytt. Thanks! |
While digging into Diagnostics there wasn't an easy way to tell all the available `kind`s that there could be since they were just a string value. So this small changes just makes the `kind` field in `Message` a `MessageKind` which is an enum of all the types of message kinds that exist.
While digging into Diagnostics there wasn't an easy way to tell all the
available
kind
s that there could be since they were just a stringvalue. So this small changes just makes the
kind
field inMessage
aMessageKind
which is an enum of all the types of message kinds thatexist.