-
Notifications
You must be signed in to change notification settings - Fork 28
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
Don't emit interface mixins #90
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh. Doesn't this mean, in some cases, you won't be able to polymorph over similar types since they won't share a base type?
Like you won't be able to make a function that takes |
That's true, but that's intentional, since they're not supposed to be used as types. https://webidl.spec.whatwg.org/#idl-interface-mixins
Do you have an example where they are that I overlooked? |
They should be added to the interfaces they are mixed into. This allows for external static members to use the right nominal type. This CL also adds some logic to handle name collisions between instance and static operations, which is now needed for exactly one pair of operations: Response.prototype.json and Response.json.
fa5c6b4
to
21beec9
Compare
I can imagine places where writing helpers/extensions on the shared types could be nice. I mean, we can always go back to these later. This is ABSOLUTELY a breaking change, though. ...I mean, if folks are actually using these types already. 🤷♂️ |
Searching GitHub gave me no results for these mixin types being used with |
They should be added to the interfaces they are mixed into. This allows for external static members to use the right nominal type. This CL also adds some logic to handle name collisions between instance and static operations, which is now needed for exactly one pair of operations: Response.prototype.json and Response.json. Also enables asserts in the translator.
#56