Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

False positive "non-empty-array<int, int> might not be a list" when change existing list key #4351

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
ondrejmirtes merged 3 commits into phpstan:2.1.x from staabm:bug13035
Sep 25, 2025

Conversation

Copy link
Contributor

@staabm staabm commented Sep 20, 2025

LastDragon-ru reacted with thumbs up emoji
@staabm staabm force-pushed the bug13035 branch 2 times, most recently from 40597c5 to c56e097 Compare September 21, 2025 06:08
@staabm staabm marked this pull request as ready for review September 21, 2025 06:17
Copy link
Collaborator

This pull request has been marked as ready for review.

Comment on lines +5701 to +5629
if (
$var === $originalVar
&& $var->dim !== null
&& $scope->hasExpressionType($var)->yes()
) {
$assignedPropertyExpr = new SetExistingOffsetValueTypeExpr(
$varForSetOffsetValue,
$var->dim,
$assignedPropertyExpr,
);
} else {
$assignedPropertyExpr = new SetOffsetValueTypeExpr(
$varForSetOffsetValue,
$var->dim,
$assignedPropertyExpr,
);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

with this change, we make sure PropertyAssignNode contains a proper type.
we already had the right type in scope from a previous fix.

@staabm staabm force-pushed the bug13035 branch 3 times, most recently from 976d0e8 to 83c5e5d Compare September 23, 2025 08:19
@ondrejmirtes ondrejmirtes merged commit 1492332 into phpstan:2.1.x Sep 25, 2025
444 of 457 checks passed
Copy link
Member

Thank you!

@staabm staabm deleted the bug13035 branch September 25, 2025 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

False positive "non-empty-array<int, int> might not be a list" when change existing list key

AltStyle によって変換されたページ (->オリジナル) /