Skip to content

Fix intersection with substracted#4132

Merged
ondrejmirtes merged 1 commit intophpstan:2.1.xfrom
VincentLanglet:fixTypeCombinator
Jul 21, 2025
Merged

Fix intersection with substracted#4132
ondrejmirtes merged 1 commit intophpstan:2.1.xfrom
VincentLanglet:fixTypeCombinator

Conversation

@VincentLanglet
Copy link
Copy Markdown
Contributor

@VincentLanglet VincentLanglet commented Jul 20, 2025

Without this fix, the intersection of

new ObjectType(DateTime::class),
new MixedType(subtractedType: new NullType()),

was DateTime~null.

Extracted from #4131

@ondrejmirtes ondrejmirtes merged commit 8bec647 into phpstan:2.1.x Jul 21, 2025
413 of 420 checks passed
@ondrejmirtes
Copy link
Copy Markdown
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.

2 participants