- From: Boris Zbarsky <bzbarsky@MIT.EDU>
- Date: Thu, 11 Oct 2012 15:15:57 -0400
- To: Jonas Sicking <jonas@sicking.cc>
- CC: Allen Wirfs-Brock <allen@wirfs-brock.com>, Brendan Eich <brendan@mozilla.org>, Robert Ginda <rginda@chromium.org>, Alec Flett <alecflett@chromium.org>, public-webapps@w3.org, "public-script-coord@w3.org" <public-script-coord@w3.org>
On 10/11/12 3:06 PM, Jonas Sicking wrote: > Make the overload resolution treat a passed 'undefined' value the same > as not passing the argument. That's not sufficient to just say; we need to define how that will actually work. The important difference being that not passing an argument is only possible at the end of the arglist, but undefined can appear in the middle. As an example, what happens in this situation: void foo(optional int x, optional int y); void foo(MyInterface? x, optional int y); and JS like so: foo(undefined, 5); Per the current overload resolution algorithm, this will invoke the second overload with a null MyInterface pointer. Is that the behavior we want? If so, all we're really saying is that overload resolution will drop _trailing_ undefined from the argc before determining the overload to use, right? I think your other suggestions are fine. -Boris
Received on Thursday, 11 October 2012 19:16:30 UTC