ponylang / rfcs

RFCs for changes to Pony
https://ponylang.io/
61 stars 48 forks source link

Lambda object capability inference. #59

Open jemc opened 8 years ago

jemc commented 8 years ago

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.

jemc commented 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.

malthe commented 8 years ago

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.

Theodus commented 7 years ago

51 resolves this

jemc commented 7 years ago

Actually, this hasn't been resolved yet - I'm still working on it.