This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
In the "how to compute an effective overload set" algorithm: 7. While i ≥ 0: 1. If argument i of X is not optional, then break this loop. 2. Otherwise, add to S the tuple <X, t0..i−1, o0..i−1>. 3. Set i to i−1. 8. If n > 0 and all arguments of X are optional, then add to S the tuple <X, (), ()> (where “()” represents the empty list). In the loop at step (7), if i == 0, then in (7.2) either the syntax <X, t0..i-1, o0..i-1> is referencing negative indexes *or* this is adding <X, (), ()> to S, which is redundant with step (8). I believe this was introduced in: https://github.com/heycam/webidl/commit/97499d48855a9f9012fe145d49b83ccd71d1738b#diff-1feda49b40370635faef8b655f144f64L3228 ... where the previous version required 0 < i < n.
Thanks Joshua! I'm referring to: http://heycam.github.io/webidl/#dfn-effective-overload-set To fix this, there are two solutions, right? Option A: Replace: 7. While i ≥ 0: with: 7. While i > 0: Option B: Remove: 8. If n > 0 ... ...and preferably amend 5.7.2 to: 2. Otherwise, add to S the tuple <X, t0..i−1, o0..i−1>; if i is 0, this means to add to S the tuple <X, (), ()> (where “()” represents the empty list). Option A is probably simpler and more explicit spec-wise, because it avoids the negative indexes and is explicit about the bound.
(In reply to Nils Barth from comment #1) > To fix this, there are two solutions, right? Yep, and I agree that A seems simpler. We might be missing some intentional subtlety, though, so I just wanted to point out the issue and let Cameron weigh in.
Tentative fix: https://github.com/heycam/webidl/pull/390
Fixed in https://github.com/heycam/webidl/commit/fb40c8e