ceylon / ceylon-spec

DEPRECATED
Apache License 2.0
108 stars 34 forks source link

left to right type inference and overload resolution #1466

Open jvasileff opened 8 years ago

jvasileff commented 8 years ago
{"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?

gavinking commented 8 years ago

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.

jvasileff commented 8 years ago

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

gavinking commented 8 years ago

I think it's really really hard, yes.