Re: IndexedDB: undefined parameters

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:29 UTC