GabrielDosReis/ipr

If_then_else set constraint to void in impl

Closed this issue · 1 comments

Given that If_then_else is the only statement that doesn't inherit it's type from one of it's children can we just set the constraint in the make_if_then_else to void.

The IPR internal language is expressions based, i.e. it is not trying to mimic exactly standard C++ with all its barnacles. It is arguable that if then else could be understood as a statement version of the ternary conditional operator, either with its complicated common type constraint, or as just a naively void-typed statement because its two branches may not always have a common type. By design, it is expected that the caller of make_if_then_else() to set its constraint field to the appropriate value, based on context.