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

Make to_idl_type infallible #1014

Merged
merged 2 commits into from
Nov 7, 2018
Merged

Conversation

alexcrichton
Copy link
Contributor

This commit makes the to_idl_type infallible, returning a new enum
variant, UnknownInterface, in the one location that we still return
None. By making this infallible we can ensure that expansion of unions
which have unknown types still generate methods for all the variants
which we actually have all the methods for!

alexcrichton and others added 2 commits November 7, 2018 10:38
This commit makes the `to_idl_type` infallible, returning a new enum
variant, `UnknownInterface`, in the one location that we still return
`None`. By making this infallible we can ensure that expansion of unions
which have unknown types still generate methods for all the variants
which we actually have all the methods for!
…types instead of returning None when there is at least one unsupported type

For example, the constructor in Response.webidl accepts multiple types. However, one of those types is `ReadableStream` which isn't defined yet, and that causes all constructors for Response to be skipped even though the other argument types could be supported.
Copy link
Member

@fitzgen fitzgen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice.

@alexcrichton alexcrichton merged commit d646b29 into rustwasm:master Nov 7, 2018
@alexcrichton alexcrichton deleted the more-types branch November 7, 2018 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants