Skip to content
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

Closed
bzbarsky opened this issue Dec 19, 2016 · 5 comments
Closed

Should mixins be able to add overloads? #261

bzbarsky opened this issue Dec 19, 2016 · 5 comments

Comments

@bzbarsky
Copy link
Collaborator

Consider this IDL:

interface A {
  void foo();
};

[NoInterfaceObject]
interface B {
  void foo(long arg);
};

A implements B;

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.

@domenic
Copy link
Member

domenic commented Dec 19, 2016

Do we know about existing specs doing this? It seems very likely they might, but if nobody does, then yeah, disallowing would be nice...

@bzbarsky
Copy link
Collaborator Author

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.

@annevk
Copy link
Member

annevk commented Dec 20, 2016

Hmm, did WebGL not get the memo that overloads in general are a poor API?

@bzbarsky
Copy link
Collaborator Author

Not really, no. They're basically trying to expose the GL APIs, and those are full of overloads or something.

@bzbarsky
Copy link
Collaborator Author

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.

tobie added a commit to tobie/webidl that referenced this issue Sep 28, 2017
tobie added a commit to tobie/webidl that referenced this issue Sep 28, 2017
tobie added a commit to tobie/webidl that referenced this issue Oct 11, 2017
* 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.
tobie added a commit to tobie/webidl that referenced this issue Oct 11, 2017
* 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.
tobie added a commit to tobie/webidl that referenced this issue Oct 11, 2017
* 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.
tobie added a commit to tobie/webidl that referenced this issue Oct 11, 2017
* 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.
tobie added a commit to tobie/webidl that referenced this issue Oct 11, 2017
* 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.
@tobie tobie closed this as completed in 45e8173 Oct 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants