Re: [heycam/webidl] Is step 4 of the effective overload set construction unnecessary? (#600)

Thanks for clarifying the intent.  Note that step 4 though says:
> 4. Let max be max(maxarg, N) 

So in your examples I  think you get a max of 4 and 5, not 2 and 4.

Additionally, I don't think there's a reason to restrict the entries of S by N when computing the effective overloads because the recipients of S already restrict it to a meaningful set:

From the [overload resolution algorithm](https://heycam.github.io/webidl/#dfn-overload-resolution-algorithm):
> 1. Let maxarg be the length of the longest type list of the entries in S.
> 2. Let n be the size of args.
> 3. Initialize argcount to be min(maxarg, n).
> 4. Remove from S all entries whose type list is not of length argcount.

The other place I see S being used is to determine length for SetFunctionLength, and in that case the caller of the effective overload set algorithm determines length as:
> Step X. Let length be the length of the shortest argument list in the entries in S

Let me know if you agree with these observations (that N doesn't need to be considered when computing the effective overload set) and I'd be happy to open a PR to update the algorithm.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/issues/600#issuecomment-447948623

Received on Monday, 17 December 2018 18:29:32 UTC