rfcs icon indicating copy to clipboard operation
rfcs copied to clipboard

Lambda object capability inference.

Open jemc opened this issue 8 years ago • 4 comments

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 avatar Oct 22 '16 15:10 jemc

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.

jemc avatar Oct 22 '16 15:10 jemc

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.

malthe avatar Oct 27 '16 08:10 malthe

#51 resolves this

Theodus avatar Dec 25 '16 23:12 Theodus

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

jemc avatar Dec 26 '16 17:12 jemc