-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should mixins be able to add overloads? #261
Comments
Do we know about existing specs doing this? It seems very likely they might, but if nobody does, then yeah, disallowing would be nice... |
There aren't any that I'm aware of (in that the Gecko IDL parser explicitly errors out in this situation, and that's not being a problem for us so far), but WebGL is trying to add this sort of thing. |
Hmm, did WebGL not get the memo that overloads in general are a poor API? |
Not really, no. They're basically trying to expose the GL APIs, and those are full of overloads or something. |
However, some of the webgl2 APIs are moving away from overloads more toward unions and optional args. They just kinda coexist with webgl1 apis that use the old setup. |
* Obsolete use of [NoInterfaceObject] extended attribute as mixins. * Add new interface mixin and partial interface mixin constructs. * Replace implements statement by includes statement which only accepts mixins on its rhs. * Remove supplemental interface and related concepts altogether. * Add generic members dfn. * Add table to clarify which members each construct accepts. * Refactor default toJSON operation, and [Exposed] and [SecureContext] algorithms accordingly. Closes whatwg#118. * Prevent operation overloading across mixins and interfaces. Closes whatwg#261. Closes whatwg#363. Closes whatwg#164. Closes https://www.w3.org/Bugs/Public/show_bug.cgi?id=26452. Closes https://www.w3.org/Bugs/Public/show_bug.cgi?id=25495.
* Obsolete use of [NoInterfaceObject] extended attribute as mixins. * Add new interface mixin and partial interface mixin constructs. * Replace implements statement by includes statement which only accepts mixins on its rhs. * Remove supplemental interface and related concepts altogether. * Add generic members dfn. * Add table to clarify which members each construct accepts. * Refactor default toJSON operation, and [Exposed] and [SecureContext] algorithms accordingly. Closes whatwg#118. * Prevent operation overloading across mixins and interfaces. Closes whatwg#261. Closes whatwg#363. Closes whatwg#164. Closes https://www.w3.org/Bugs/Public/show_bug.cgi?id=26452. Closes https://www.w3.org/Bugs/Public/show_bug.cgi?id=25495.
* Obsolete use of [NoInterfaceObject] extended attribute as mixins. * Add new interface mixin and partial interface mixin constructs. * Replace implements statement by includes statement which only accepts mixins on its rhs. * Remove supplemental interface and related concepts altogether. * Add generic members dfn. * Add table to clarify which members each construct accepts. * Refactor default toJSON operation, and [Exposed] and [SecureContext] algorithms accordingly. Closes whatwg#118. * Prevent operation overloading across mixins and interfaces. Closes whatwg#261. Closes whatwg#363. Closes whatwg#164. Closes https://www.w3.org/Bugs/Public/show_bug.cgi?id=26452. Closes https://www.w3.org/Bugs/Public/show_bug.cgi?id=25495.
* Obsolete use of [NoInterfaceObject] extended attribute as mixins. * Add new interface mixin and partial interface mixin constructs. * Replace implements statement by includes statement which only accepts mixins on its rhs. * Remove supplemental interface and related concepts altogether. * Add generic members dfn. * Add table to clarify which members each construct accepts. * Refactor default toJSON operation, and [Exposed] and [SecureContext] algorithms accordingly. Closes whatwg#118. * Prevent operation overloading across mixins and interfaces. Closes whatwg#261. Closes whatwg#363. Closes whatwg#164. Closes https://www.w3.org/Bugs/Public/show_bug.cgi?id=26452. Closes https://www.w3.org/Bugs/Public/show_bug.cgi?id=25495.
* Obsolete use of [NoInterfaceObject] extended attribute as mixins. * Add new interface mixin and partial interface mixin constructs. * Replace implements statement by includes statement which only accepts mixins on its rhs. * Remove supplemental interface and related concepts altogether. * Add generic members dfn. * Add table to clarify which members each construct accepts. * Refactor default toJSON operation, and [Exposed] and [SecureContext] algorithms accordingly. Closes whatwg#118. * Prevent operation overloading across mixins and interfaces. Closes whatwg#261. Closes whatwg#363. Closes whatwg#164. Closes https://www.w3.org/Bugs/Public/show_bug.cgi?id=26452. Closes https://www.w3.org/Bugs/Public/show_bug.cgi?id=25495.
Consider this IDL:
Should this be allowed? I think the current spec more or less allows it, not least because it's pretty vague about when overload sets are actually determined. But it's not entirely obvious to me whether this is desirable, because this makes the mixin change the behavior of existing methods on the interface, which is something that should really go in the base spec, not a mixin, I would think.
The text was updated successfully, but these errors were encountered: