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 regression #995

Merged
merged 1 commit into from Feb 4, 2022
Merged

Fix regression #995

merged 1 commit into from Feb 4, 2022

Conversation

arnaud-lb
Copy link
Contributor

@arnaud-lb arnaud-lb commented Feb 4, 2022

Fixes a regression introduced in #992

For UnionType::accepts(TemplateUnionType) to work, we must treat it as a non-UnionType

Actually we need to treat the TemplateUnionType as both a non-UnionType and a UnionType for these two cases:

  1. (T|null)->accepts(T)
  2. (int|float)->accepts(T of (int|float))

In case 1 the TemplateUnionType acts as a member of the UnionType
In case 2 the TemplateUnionType acts as a UnionType

@ondrejmirtes ondrejmirtes merged commit 705b460 into phpstan:master Feb 4, 2022
@ondrejmirtes
Copy link
Member

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants