[Bug 25630] "The following use of overloading however is inv..."

# bugzilla at jessica.w3.org (3 years ago)

www.w3.org/Bugs/Public/show_bug.cgi?id=25630

Anne annevk@annevk.nl changed:

       What    |Removed                     |Added

             CC|                            |annevk@annevk.nl

--- Comment #1 from Anne annevk@annevk.nl ---

I think it's still invalid to accept both string and number because it's unclear whether you should use ToString or ToNumber.

Contact us to advertise here
# bugzilla at jessica.w3.org (3 years ago)

www.w3.org/Bugs/Public/show_bug.cgi?id=25630

--- Comment #2 from Nils Barth nbarth+w3bugzilla@google.com ---

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) heycam.github.io/webidl/#dfn-overload-resolution-algorithm

In detail:

  1. 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 ...

  2. Otherwise: if there is an entry in S that has one of the following types at position i of its type list, • DOMString ...

  3. 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 ...

# bugzilla at jessica.w3.org (2 days ago)

www.w3.org/Bugs/Public/show_bug.cgi?id=25630

Tobie Langel tobie.langel@gmail.com changed:

       What    |Removed                     |Added

     Resolution|---                         |DUPLICATE
         Status|NEW                         |RESOLVED
             CC|                            |tobie.langel@gmail.com

--- Comment #3 from Tobie Langel tobie.langel@gmail.com ---

This bug has been marked as a duplicate of bug 23879

Want more features?

Request early access to our private beta of readable email premium.