Skip to content

Do not accept raw ObjectType in intersection as GenericObjectType<TemplateType>#5926

Merged
ondrejmirtes merged 1 commit into
phpstan:2.2.xfrom
rvanvelzen:bug-13190-extra
Jun 24, 2026
Merged

Do not accept raw ObjectType in intersection as GenericObjectType<TemplateType>#5926
ondrejmirtes merged 1 commit into
phpstan:2.2.xfrom
rvanvelzen:bug-13190-extra

Conversation

@rvanvelzen

Copy link
Copy Markdown
Contributor

Closes phpstan/phpstan#13190. My previous PR did fix an issue in there but not the actual bug that was reported.

In general AI works wonders but sometimes it strays too much and I didn't catch it this time. Sorry!

Comment thread src/Type/IntersectionType.php Outdated
@ondrejmirtes

Copy link
Copy Markdown
Member

Please check these changes https://github.com/phpstan/phpstan-src/actions/runs/28099136495 and evaluate how valid they are

Closes phpstan/phpstan#13190

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rvanvelzen

Copy link
Copy Markdown
Contributor Author

I just love how covering the test suite is. You guys are doing a great job 💪

@ondrejmirtes ondrejmirtes merged commit bad7874 into phpstan:2.2.x Jun 24, 2026
670 of 672 checks passed
@ondrejmirtes

Copy link
Copy Markdown
Member

Thank you!

@rvanvelzen rvanvelzen deleted the bug-13190-extra branch June 24, 2026 13:55
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.

asserting Foo<T>|T is Foo should result in Foo<T>|Foo not Foo<T>

2 participants