Skip to content

Fix TypeCombinator::union() for intersection of array and template type#1444

Merged
ondrejmirtes merged 1 commit intophpstan:1.7.xfrom
rvanvelzen:bug-4117
Jun 20, 2022
Merged

Fix TypeCombinator::union() for intersection of array and template type#1444
ondrejmirtes merged 1 commit intophpstan:1.7.xfrom
rvanvelzen:bug-4117

Conversation

@rvanvelzen
Copy link
Copy Markdown
Contributor

@ondrejmirtes ondrejmirtes merged commit b1069e1 into phpstan:1.7.x Jun 20, 2022
@ondrejmirtes
Copy link
Copy Markdown
Member

Thank you!

@rvanvelzen rvanvelzen deleted the bug-4117 branch June 20, 2022 07:39
@ondrejmirtes
Copy link
Copy Markdown
Member

I've added a type inference test: 98ab8c9

I think that the results in if/else are correct, but the type below the if/else should be better because it has subtracted falsy values but in fact the returned type can still be falsy. (The union of the types inside if/else is probably wrong).

@AJenbo
Copy link
Copy Markdown
Contributor

AJenbo commented Jun 20, 2022

Nice work :)

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.

Empty if clause changes type of variable from T|null to T|array|null

3 participants