ceylon/ceylon-spec

left to right type inference and overload resolution

jvasileff opened this issue · 3 comments

{"1"}.map((s) => JLong.parseLong(s)); // 1
{"1"}.map(JLong.parseLong);  // 2
// ambiguous callable reference to overloaded method or class: 'parseLong' is overloaded

Given that 1 works, would it be possible to also support 2?

Ugh. I'm not 100% certain but IIRC it is not possible, no. There is a totally pathological interdependence between type argument inference and overload resolution that means we can't have both.

Ok. The workaround isn't so bad. I thought this might be either really easy or really hard 😄

I think it's really really hard, yes.