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
InvalidArgumentException + out of memory #8182
Comments
important notice, the error appears from version 4.22 on. 4.21 and below is okay. |
It was most likely caused by this change: https://github.com/vimeo/psalm/pull/7727/files#diff-41dfd662b2225a26b01170877d516fe5ef1df0ef8d7703cf8527b50bbcf4bac6R66 My guess is that the compatibility layer where the trait is declared twice is badly handled in Psalm (this is not a surprise, having two symbols with the same name but different behaviour is pretty much impossible to handle) and that cause Psalm to not have this symbol registered here at all |
I'll try to get around to fixing that soon. @orklah I'm thinking it might work well to store some sort of identifier (filename + offset?) in the class storage, then when analyzing if that identifier from the class storage doesn't match the class declaration, we can re-scan the class to get the storage for the current declaration. I'm hoping having the identifier will prevent performance regressions since generally there will only be one class declaration for the majority of classes. I suppose if there are multiple declarations the identifier should probably either be set to null or combined somehow so it doesn't match any of the declarations, forcing a rescan when each declaration is analyzed. If this works it should also improve analysis overall whenever there are multiple class declarations, so you don't have false negatives like this. It still leaves the problem of correctly merging conditional declarations, but I'll just leave that for later. I haven't actually tried implementing any of this yet though, so we'll see how it ends up going. |
|
hi,
same code, different psalm versions.
with psalm
v4.15.0
--> all fine, no errorswith psalm
v4.23.0
:with
--debug --debug-by-line
it get:without
--debug --debug-by-line
and using only one thread, I get:in case it has something to do with it, here´s the HistoryTrait.php
is there anything I can do except going back to 4.15 ?
thanks for any help!
The text was updated successfully, but these errors were encountered: