This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
http://heycam.github.io/webidl/#idl-overloading This is outdated: [[ The following use of overloading however is invalid: IDL interface B { void f(DOMString x); void f(float x); }; since DOMString and float are not distinguishable. ]] ...since DOMStrings and floats (numerics) are now distinguishable. This can be corrected by replacing "DOMString" with "long": [[ The following use of overloading however is invalid: IDL interface B { void f(long x); void f(float x); }; since long and float are not distinguishable. ]]
I think it's still invalid to accept both string and number because it's unclear whether you should use ToString or ToNumber.
AFAICT, String vs. Number is handled in the overload resolution algorithm (nutshell: if argument is a Number, resolve to numeric if possible; otherwise use ToString if possible, otherwise use ToNumber if possible) http://heycam.github.io/webidl/#dfn-overload-resolution-algorithm In detail: 10. Otherwise: if V is a Number value, and there is an entry in S that has one of the following types at position i of its type list, • a numeric type ... 11. Otherwise: if there is an entry in S that has one of the following types at position i of its type list, • DOMString ... 12. Otherwise: if there is an entry in S that has one of the following types at position i of its type list, • a numeric type ...
*** This bug has been marked as a duplicate of bug 23879 ***