Menu

#50 can contracts for unions be supported?

1.1.0
accepted
None
Functionality
trivial
0.4.0
enhancement
2012-09-10
2012-05-13
No

Previous revisions of the library did not support unions because they had no constructors so the state variable used to disable contracts in nested calls could not be initialized.
However, there is no longer such a variable because nested calls disabled nothing (as per N1962 requirements) so it might be possible to support contracts for unions.

This possibility should be investigated.
If unions could not be supported, the reason should be documented in a rationale footnote.

Discussion

  • Lorenzo Caminiti

    • priority changed from minor to trivial
    • status changed from new to accepted

    It is not clear if anyone will ever need to program a contract for a union (unions are usually used to mess-up with memory blocks so they are not really a class in the OO sense and contracts don't have to be attached to the union itself, maybe to functions that use the union).
    If possible, I should still support contracts for unions but just for completeness.

     
  • Lorenzo Caminiti

    • milestone changed from Future to 1.1.0
     

Log in to post a comment.