-
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
Forbid overloading operations with Promise and non-Promise return types. #776
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.
This seems reasonable but I wonder if https://www.w3.org/Bugs/Public/show_bug.cgi?id=25051 has more to it. In particular the sentence @bzbarsky quotes there remains, and e.g. for void/Window overloads (like document.open), "the return type" is still problematic.
As such I'll leave @bzbarsky to give approval on the best approach here. (But thanks for tackling old issue-tracker issues!!)
We should probably go through the uses of the "return type" concept in the spec and see what they actually want. Maybe we should actually have a "set of return types". For example, the We could then require that all the types in the set either are or are not promise types and switch on that boolean in the operation steps that check for promise return type. In general, it seems we use "return type" in the following normative language:
I think that's it. I'm happy to solve the promise-vs-not problem for a start, because I think that's the only "real" problem here in practice, or have a slightly more extensive refactoring if desired. |
We're generally not clear on whether an "operation" is a single signature or a set of signature; that also causes issues in the loop over all operations in define the operations, for example. I'd like to untangle it all at some point, but not in this PR. |
It should also be disallowed to have |
See https://heycam.github.io/webidl/#dfn-distinguishable and "Example 27" following it. |
Closes #79. This removes support for overloading promise operations and non-promise operations, per whatwg/webidl#776.
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.
Let's merge this and spin off a separate issue for examining the "return type" problem generally.
Fixes https://www.w3.org/Bugs/Public/show_bug.cgi?id=25051.
Preview | Diff