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

only return true in Union::is*Type* if there is a single type #6829

Merged
merged 1 commit into from
Nov 5, 2021

Conversation

orklah
Copy link
Collaborator

@orklah orklah commented Nov 5, 2021

This fixes a inconsistency I noticed. Union has two sets of useful functions: has*Type* and is*Type*. has ones checks that the type is in there while is ones checks that the only type(s) in the union are of the given type.

Before the fix, it allowed for isEmptyMixed or isEmpty to return true for empty-mixed|2 and empty|2 for example. It's quite unlikely this lead to actual bugs because those types are pretty rare, especially in Union with other types, but I didn't want to leave this like that :)

@orklah orklah added the release:fix The PR will be included in 'Fixes' section of the release notes label Nov 5, 2021
@orklah orklah merged commit f4dcea3 into vimeo:master Nov 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:fix The PR will be included in 'Fixes' section of the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant