Skip to content

Add regression test for #12743 - #6789

Merged
staabm merged 1 commit into
phpstan:2.3.xfrom
pawell67:chore/bug-12743-regression-test
Oct 23, 2026
Merged

staabm merged 1 commit into
phpstan:2.3.xfrom
pawell67:chore/bug-12743-regression-test

Conversation

@pawell67

@pawell67 pawell67 commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Regression test for phpstan/phpstan#12743.

On the current 2.3.x the conditional return type of execute() is resolved again for the snippet from the issue (null, int, string for Base<0>, Base<1>, Base<2>). The two remaining errors the playground reports on the original snippet come from its own assertions: static<self::INT> called on a Base<0> is Base<1>, not Root<1>, so the test asserts Base<1> and Base<2>.

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@staabm

staabm commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

//cc @SanderMuller

@SanderMuller SanderMuller left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked 7974bc7.

  • The test passes on this head. With it on 87bbf77, the parent of #6695, it fails with Expected: int, Actual: null and Expected: string, Actual: null. So #6695 is the fix, which matches the bot's comparison on the issue.
  • The reporter's snippet on this head only reports the two Root<1> and Root<2> assertions. I agree with Base<1> and Base<2>: becomeInt() returns static<self::INT>, and static is Base here.
  • The test also passes with the turbo extension active (macOS arm64, PHP 8.5).
  • lint >= 8.0 is needed for the match in execute().
  • There is no source change, so there is no performance effect.
  • The two red jobs, result-cache-parse-error and the Tempest integration job, also fail on other current 2.3.x PRs.

One thing: the description has no Closes phpstan/phpstan#12743, so close-issues-on-merge.yml will not close the issue after the merge.

@staabm
staabm merged commit c2befd8 into phpstan:2.3.x Oct 23, 2026
988 of 990 checks passed
@staabm

staabm commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

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.

3 participants