au-ts / cogent

Cogent Project
https://trustworthy.systems/projects/TS/cogent.pml
Other
158 stars 26 forks source link

Variant tags can have under-specified layout #386

Open zilinc opened 3 years ago

zilinc commented 3 years ago

We don't allow layouts to be under-specified for now. E.g., a Bool type can't be larger than 1 bit. This design simplifies C code generation a lot, and also makes sense, as you really don't need more space than necessary to store anything. Variant tags are not currently checked for under-specification. They can be larger than necessary; this is just a thing we haven't implemented in the typechecker, and should be relatively easy to add.

zebraNeon commented 3 years ago

please take a look at #393