Repository navigation
Preserve source types during destructuring assignments - #6760
Open
Gabrieljr42 wants to merge 2 commits into
Open
Gabrieljr42 wants to merge 2 commits into
Gabrieljr42 wants to merge 2 commits into
Conversation
Author
|
I checked the two E2E failures. The parse-error case has the same "expected 1, got 0" failure on the current 2.3.x base. The other job stopped while downloading the bashunit checksum, before running its tests. Both local full suites passed, with and without Turbo. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes phpstan/phpstan#15091.
Also covers the case in phpstan/phpstan#15181.
Destructuring now keeps the original source types while assigning each item. Reusing the source variable in an earlier item no longer changes the inferred types of the remaining items. I applied the same fix to the Turbo implementation and updated its expected version.
The regression fails on the original code and passes after the fix. I ran the full suite on PHP 8.3 with and without Turbo: 22,340 tests in each run, 204 skipped, no failures. The native run uses one worker with batches of 10 files to keep memory usage down.
The strict native build, smoke test, signature check and regression walk trace also pass. The side-by-side script reports the same diagnostics on the base and this branch, with identical output.
I used AI assistance for the implementation and tests.