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

fix refining lowercase string and non-empty-string together #7844

Merged
merged 1 commit into from
Apr 5, 2022

Conversation

orklah
Copy link
Collaborator

@orklah orklah commented Apr 5, 2022

This should fix #7843 (on Psalm 5 though...)

For the explanation: Psalm assertions works well when one of the two type is a super type of another (isContainedBy method). When that happens, Psalm just takes the narrower type and goes on. Issues arise when none of the type is completely included in another. (A great example is the condition just above with int<0, 10> and int<5, 15> which should result in int<5, 10> but need to be handled separately).

This is the same with non-empty-string and lowercase-string, the intersection of both is possible within Psalm's type system (non-empty-lowercase-string) but none is completely included in the other

@orklah orklah added the release:fix The PR will be included in 'Fixes' section of the release notes label Apr 5, 2022
@orklah
Copy link
Collaborator Author

orklah commented Apr 5, 2022

Failure is unrelated, I'll have to check that later

@orklah orklah merged commit d176361 into vimeo:master Apr 5, 2022
Copy link
Contributor

@Ocramius Ocramius left a comment

Choose a reason for hiding this comment

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

Nice!

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.

2 participants