Skip to content

Fix interaction between template type and intersection type#955

Merged
ondrejmirtes merged 1 commit intophpstan:masterfrom
arnaud-lb:bug-6210
Jan 30, 2022
Merged

Fix interaction between template type and intersection type#955
ondrejmirtes merged 1 commit intophpstan:masterfrom
arnaud-lb:bug-6210

Conversation

@arnaud-lb
Copy link
Contributor

This fixes phpstan/phpstan#6210 by ensuring that TemplateType | (TemplateType & something) is collapsed to TemplateType. This was not happening because TemplateType was not considered to be a super type of an intersection containing itself.

@ondrejmirtes
Copy link
Member

Thank you, I’d love to merge this, it even fixed an ignored bug in one of the integration-tested projects 😊

@arnaud-lb arnaud-lb marked this pull request as ready for review January 29, 2022 16:21
@ondrejmirtes ondrejmirtes merged commit f8af5dc into phpstan:master Jan 30, 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

Development

Successfully merging this pull request may close these issues.

Method expects Template of object, Template of object|Template of object given.

2 participants

Comments