Open jemc opened 8 years ago
I'm assigning this to myself, as I've already started on a proof of concept implementation, and will write up an RFC as soon as I have confirmed it to be working.
A lambda with only val captures also becomes a ref. This seems wrong at any rate. It shouldn't be necessary to recover val ... end
when it is already in theory a val.
Actually, this hasn't been resolved yet - I'm still working on it.
When a lambda is assigned to a reference with a definite type, or passed as an argument, we want to infer the capability of the resulting object literal based on the left hand side, instead of infering based on the content/structure of the lamba.
See https://github.com/ponylang/ponyc/issues/415 for the discussion that led to this conclusion.