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

Fix bug in array-shape subtraction #3308

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

Closed
staabm wants to merge 8 commits into phpstan:1.11.x from staabm:bug11488
Closed

Conversation

@staabm
Copy link
Contributor

@staabm staabm commented Aug 9, 2024

mvorisek reacted with heart emoji mvorisek reacted with rocket emoji
Comment on lines +397 to +402
Copy link
Contributor Author

@staabm staabm Aug 9, 2024
edited
Loading

Choose a reason for hiding this comment

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

we somehow need to identify which constant arrays we can/want to keep separte (in our case tagged unions), without running into "is always false" comparison false positives like

list<array{string, 1|2|3|4|5|6|7}> and list<array{string, 1|2|3|4|5|6|7, int}> will always evaluate to false

I think my approach is wrong, but I have no better idea atm

Copy link
Member

@ondrejmirtes ondrejmirtes Aug 9, 2024

Choose a reason for hiding this comment

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

Any change to isSuperTypeOf logic needs tests in TypeCombinatorTest::dataUnion and dataIntersect. So please express there what you're trying to achieve, only when reviewing that I can decide if it makes sense or not.

Copy link
Contributor Author

@staabm staabm Aug 12, 2024
edited
Loading

Choose a reason for hiding this comment

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

I could not figure out a dataUnion and dataIntersect test.

but what made sense to me was a test like
subtract array{mixed} from array{mixed, string|null, mixed}|array{mixed} should lead to array{mixed, string|null, mixed}

Comment on lines +29 to +30
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think thats another bug

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed via #3309

Comment on lines +397 to +402
Copy link
Member

@ondrejmirtes ondrejmirtes Aug 9, 2024

Choose a reason for hiding this comment

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

Any change to isSuperTypeOf logic needs tests in TypeCombinatorTest::dataUnion and dataIntersect. So please express there what you're trying to achieve, only when reviewing that I can decide if it makes sense or not.

Copy link
Contributor

Can this PR be finished please, many of our CI pipelines are still failing because of this. Thank you in advance!

Copy link
Contributor Author

staabm commented Aug 20, 2024

@mvorisek will continue after vacation. Please make sure to sponsor my efforts. Thanks in advance

mvorisek reacted with thumbs up emoji

Copy link
Member

@staabm FYI my patience with @mvorisek has run out and I blocked him for 1 week.

Copy link
Contributor

@ondrejmirtes, Ondřej, I do not want you to talk to me like this. If some of my communication ruin your patience, please always share the reasons with me to be able to understand your attitude better. I hope we can talk about these feelings openly. Thank you.

Copy link
Contributor

Hi @staabm do you remember what is missing in this PR ? Do you want me to try to finish it ?

Copy link
Contributor Author

staabm commented Oct 17, 2025

@VincentLanglet I can't remember. feel free to continue it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ondrejmirtes ondrejmirtes ondrejmirtes requested changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

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