Closed io7m closed 2 years ago
Variant types were specifically designed to be represented as sealed classes. There was no attempt made to provide any kind of visitor abstraction or anything like that, because that would result in an API-breaking change to the generated code when sealed classes were introduced and the visitors removed.
javapoet
doesn't support these, so generation will be manual. Probably not a problem.
Done.
The compiler is written in a manner that should make it easy to migrate to sealed classes when those get into an LTS JDK (likely JDK 17). Upgrade all pseudo-algebraic types in the compiler to sealed classes, and upgrade the code generator to generate sealed classes.