qitab / cl-protobufs

Common Lisp protocol buffer implementation.
MIT License
78 stars 17 forks source link

Add strict typing to enums #382

Closed copybara-service[bot] closed 1 year ago

copybara-service[bot] commented 1 year ago

Add strict typing to enums

We should be able to add strict typing to enum fields both on a struct and in the conversion functions. To do this we make a "open" type, namely a type that allows the current set of enums plus keywords of the form :%undefined-{integer}, which we may get due to backwards compatibility requirements. We also remove the "default" arguments for int2keyword and keyword2int functions.

This gives us strict typechecking, no longer will there be the ability to set badly named enum fields!