Skip to content

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Sep 20, 2025

@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
@phpstan-bot
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
@ondrejmirtes
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

Labels

None yet

Projects

None yet

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

3 participants