frankpfenning / C0

C0 Language
4 stars 0 forks source link

Require conditionals in tertiary expressions to have small type #27

Closed robsimmons closed 11 years ago

robsimmons commented 11 years ago

This would allow

x ? y.baz.bar : z.foo.bar

instead of the following (equivalent by commutative conversion if y and z have the same type)

(x ? y.baz : z.foo).bar

This change would completely resolve #10

robsimmons commented 11 years ago

Rob - investigate whether address-of is still necessary in compilation in this case.

Answer: no it does not:

A[3].f = foo(17);

this code first gets the location &(A[3].f), then calculates foo(17), then does the (pure) assignment of the result value into the memory within A[3].f.

robsimmons commented 11 years ago

Possible resolutions:

Both of these would fix stuff of low priority. Who in the compilers class needs to be notified of this?

Assigned to Frank to think about, Rob can implement either solution (especially the first) once Frank thinks about it.

robsimmons commented 11 years ago

Decision: pull the trigger on this issue and require condition expressions to have small type.

frankpfenning commented 11 years ago

Done, as of revision r216.