Ambiguous varargs
PatchaFeb 21 2012 — edited Feb 24 2012Hi all!
I have a series of method with same names, but which accept different type of varargs... which means the series of primtiives types and gerical type <T>.
The problem is that they generate "ambiguity" erros when building java code... how's that possible?
Shouldn't be Java smart enough to understand that a "*method(0.0f);*" call have to point to "*method(float... f)*" and not to "*method(double... d)*" or worse "*method(T... t)*"?
Even "*method(char... c)*" generates ambiguity with "*method(double... d)*"!!!
This really disappointed me.
There is something I can do, other than giving different name to each method?
Edited by: EJP on 22/02/2012 08:45: fixed typo in title