Re: [WebIDL] On overloaded operations in an effective overload set

Shiki Okasaka:
> The [AllowAny] extended attribute looks nice, and it will provide a
> clearer ECMAScript runtime semantics. One thing still not very clear
> to me is that a DOMString with [AllowAny] and a primitive type should
> be distinguishable as in the example or not;

I am thinking that [AllowAny] is an ECMAScript-specific extended
attribute that just influences the overload resolution algorithm.  As
such, it wouldn’t affect the definition of “distinguishable”.  So:

  void f(in DOMString x);
  void f([AllowAny] in long x);

would remain distinguishable, unlike:

  void f(in DOMString x);
  void f(in any x);

> maybe should we treat a parameter with [AllowAny] like an 'any' type
> in an effective overload set for simplicity?

It is effectively treated as ‘any’ in the overload resolution
algorithm, since if the there is a true value in the list of booleans
that is the third element of the triples in the effective overload set,
any removals of entries from the set are skipped when looking at that
argument position.

-- 
Cameron McCormack ≝ http://mcc.id.au/

Received on Wednesday, 17 June 2009 09:15:44 UTC