Skip to content
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

Merge 4.x #8591

Merged
merged 243 commits into from Oct 17, 2022
Merged

Merge 4.x #8591

merged 243 commits into from Oct 17, 2022

Conversation

danog
Copy link
Collaborator

@danog danog commented Oct 16, 2022

No description provided.

aszenz and others added 30 commits May 21, 2022 17:39
…multiple-psalm-instances

use lock to fix race condition in cache
…rror-log

use error_log instead of trigger_error
Fix GEOSGeometry stubs with default values
… static methods inside a different class

differentiate between `static` defined in a class which CALLS a given static method, and `static` defined in the method which IS CALLED.
…xistingAtomicStaticCallAnalyzer::getMethodReturnType()
Adds support for fixing missing throws doc block
Fix nullable return types for CallMap functions
Improve inferring the "final" `static` type when calling static methods inside a different class
…fig-not-working

fix triggerErrorExits not working
Fixed ini_set types for arg value
@danog danog marked this pull request as ready for review October 17, 2022 10:55
@danog
Copy link
Collaborator Author

danog commented Oct 17, 2022

I reverted a change in the CastAnalyzer that caused the creation of disjoint integer ranges, which aren't properly supported by all of psalm right now.
I initially wanted to move the disjoint integer range merging logic from CastAnalyzer to TypeCombiner, but decided to postpone it for a future PR, marking as skipped related tests.

As usual, phpunit errors are caused by an outdated baseline, I think I'll just re-update the baseline on my immutability PR to include new errors.

@kkmuffme
Copy link
Contributor

@danog what part of CastAnalyzer was reverted? (I guess it was part of my PR) Just asking, in case I can improve it to return a generic int in case we have disjoint ranges, instead of reverting that part.

@danog
Copy link
Collaborator Author

danog commented Oct 17, 2022

It was precisely this commit from master: 525a86e
The problem is that the new logic from 4.x creates an array of atomic types (including the TBool/TTrue/TFalse logic introduced on master separately) which are then combined with the TypeCombiner.

The TypeCombiner has a very generic logic which joins literals with integer ranges by always extending the lower/higher bound, even for non-adjacent values (ie 0 and int<3, max> => int<0, max>).

This should be fixed separately by improving the literal+range and range+range combining logic directly inside TypeCombiner to generate multiple distinct disjoint ranges and literals, and I actually started doing that, but then noticed that some parts of psalm like offset detection misbehaved with literal+range unions, so I postponed this for a later PR.

The current version contained in this PR properly casts booleans, but generates an overly large integer range.

@orklah orklah added the release:internal The PR will be included in 'Internal changes' section of the release notes label Oct 17, 2022
@orklah orklah merged commit 212281d into vimeo:master Oct 17, 2022
@orklah
Copy link
Collaborator

orklah commented Oct 17, 2022

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:internal The PR will be included in 'Internal changes' section of the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet