Skip to content

Fix method call on unioned class type analysis is broken#5225

Open
VincentLanglet wants to merge 4 commits intophpstan:2.1.xfrom
VincentLanglet:create-pull-request/patch-8y7mxaj
Open

Fix method call on unioned class type analysis is broken#5225
VincentLanglet wants to merge 4 commits intophpstan:2.1.xfrom
VincentLanglet:create-pull-request/patch-8y7mxaj

Conversation

@VincentLanglet
Copy link
Contributor

phpstan-bot and others added 3 commits March 15, 2026 23:04
- In UnionType::getUnresolvedMethodPrototype(), stopped overriding each
  member's calledOnType with the full union for non-template unions
- Template union types (TemplateUnionType, TemplateBenevolentUnionType)
  still propagate the union as calledOnType to preserve template identity
- Updated existing test assertion in static-late-binding.php
- Added regression test tests/PHPStan/Analyser/nsrt/bug-11687.php

Closes phpstan/phpstan#11687
Closes phpstan/phpstan#12562

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Automated fix attempt 1 for CI failures.
Automated fix attempt 2 for CI failures.
@VincentLanglet VincentLanglet force-pushed the create-pull-request/patch-8y7mxaj branch from cb2e144 to bc9e8c4 Compare March 15, 2026 22:23
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