rocketraman
06/28/2021, 8:26 PM__UNKNOWN
elements for enums? They are annoying because they basically break exhaustive whens. I'd rather have the compiler tell me a new enum was added and it needs to be handled rather than dealing with __UNKNOWN
explicitly everywhere.rocketraman
06/28/2021, 8:27 PMDariusz Kuc
06/28/2021, 8:40 PMDariusz Kuc
06/28/2021, 8:41 PMDariusz Kuc
06/28/2021, 8:42 PMrocketraman
06/28/2021, 11:00 PM*you certainly can throw exceptions on unknows but that is your explicit choice vs uncaught exception trying to serialize some unknown valueRight. I'm asking about how to make that choice once at code gen time rather than at every place I use an enum in my code -- I'm fine with a runtime exception on an out of sync enum value.
rocketraman
06/28/2021, 11:16 PMDoesnt matter whether it is server side app or notOf course it does. I control the lifecycle of a server-side app (as opposed to a mobile app, say). Therefore the risk of an unknown enum, while possible, is both a) known, and b) controllable.
Dariusz Kuc
06/28/2021, 11:29 PMrocketraman
06/28/2021, 11:30 PMDariusz Kuc
06/28/2021, 11:33 PMmbonnin
06/29/2021, 12:03 PMrocketraman
06/29/2021, 1:27 PM__UNKNOWN
.