4 ms·
I wonder if you could implement this all within a linter on top of Rust or some other language? Some of your asks already exist at that level (for example, Type
by lukevp 6y ago
I wonder if you could implement this all within a linter on top of Rust or some other language? Some of your asks already exist at that level (for example, TypeScript autocomplete in VS Code knows which enums you haven’t checked in a switch, and it also knows if a property has been verified that you’ve narrowed via a type union, so perhaps you could extend this to enforce coverage of switch statements?
- bombela 6y agoThe Rust compiler already enforces that you match all variants of an enum. And Rust Enum is basically a C union with an integer tag.