<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>25630</bug_id>
          
          <creation_ts>2014-05-09 08:15:00 +0000</creation_ts>
          <short_desc>&quot;The following use of overloading however is inv...&quot;</short_desc>
          <delta_ts>2017-07-28 14:41:06 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>WebIDL</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>23879</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Nils Barth">nbarth+w3bugzilla</reporter>
          <assigned_to name="Cameron McCormack">cam</assigned_to>
          <cc>annevk</cc>
    
    <cc>mike</cc>
    
    <cc>public-script-coord</cc>
    
    <cc>tobie.langel</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>105529</commentid>
    <comment_count>0</comment_count>
    <who name="Nils Barth">nbarth+w3bugzilla</who>
    <bug_when>2014-05-09 08:15:00 +0000</bug_when>
    <thetext>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 &quot;DOMString&quot; with &quot;long&quot;:

[[
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.
]]</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105694</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-05-12 09:02:10 +0000</bug_when>
    <thetext>I think it&apos;s still invalid to accept both string and number because it&apos;s unclear whether you should use ToString or ToNumber.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105698</commentid>
    <comment_count>2</comment_count>
    <who name="Nils Barth">nbarth+w3bugzilla</who>
    <bug_when>2014-05-12 09:19:22 +0000</bug_when>
    <thetext>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
...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>128799</commentid>
    <comment_count>3</comment_count>
    <who name="Tobie Langel">tobie.langel</who>
    <bug_when>2017-07-28 14:41:06 +0000</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 23879 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>