-
Notifications
You must be signed in to change notification settings - Fork 529
Detect more possibly-impossible offset #4164
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
base: 2.1.x
Are you sure you want to change the base?
Conversation
I feel like the error could always be reported on level 7+. The difference is that the |
35af5a4
to
f4b6dbd
Compare
c290ea1
to
2417411
Compare
This pull request has been marked as ready for review. |
2417411
to
0a8a1e2
Compare
0a8a1e2
to
accabee
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still not so sure about this, the impact seems high...
{ | ||
"message": "Possibly invalid array key type int|object.", | ||
"line": 35, | ||
"ignorable": true | ||
}, | ||
{ | ||
"message": "Offset int|object might not exist on array{baz: 21}|array{foo: 17, bar: 19}.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks wrong for array{foo: 17, bar: 19}|array{baz: 21}
. int|object
never exists on these arrays.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, I think this is because of #4272 which need to be fix/merged first then.
Closes phpstan/phpstan#1061