-
Notifications
You must be signed in to change notification settings - Fork 659
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
5.22.0 regression: Could not get class storage for psl\range\upperboundrangeinterface #10706
Comments
I got the same kind of crash. When I had the error on 5.21.1 I tried to get some insights with --debug which did not help me at all. Interestingly in 5.22.0 psalm successfully completes when applying |
|
Thanks, that's the solution indeed. I'll stick to 5.18 for now (I know 5.19 and/or 5.20 would probably work as well). |
I'm experiencing the same issue
|
@zerkms I was unable to reproduce the issue in this repo: https://github.com/weirdan/10706 |
I also went through https://github.com/search?q=psalm+5.22.0+is%3Aopen+status%3Afailure+&type=pullrequests and couldn't find any public repo experiencing this issue. |
@weirdan (and all) sorry I didn't provide the actual repro repository in the beginning. It's Friday afternoon here, and I'm quite busy doing something else. I promise to provide a repository on Monday, Feb 19th, when I'm back to my development tasks. Sorry again :-) |
Just shooting in the dark here but looking at the classes that are failing (and my private one) could this be a case of intersection types that are interfaces being tested by psalm as classes? My theory is that in the code somewhere all the classes that are failing are referenced as an intersect somewhere else |
I can second on that, I'm getting the issue for a doctrine entity property annotated as: use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\Selectable;
use Doctrine\ORM\Mapping as ORM;
class Product
{
/** @var Selectable<int, ProductPrice>&Collection<int, ProductPrice> */
#[ORM\OneToMany(
targetEntity: ProductPrice::class,
mappedBy: 'product',
cascade: ['persist', 'remove'],
fetch: 'EAGER',
orphanRemoval: true,
)]
private Selectable&Collection $prices;
} Tried to reproduce on psalm.dev somehow but failed so far. |
Psalm.dev isn't threaded which is also part of the issue. |
If you look at an another issue (which I think is actually a dup of this issue). You'll see something interesting (#10708 (comment)) in the stack that was obtained through dbgp
Look at line 4 of this. 🤔 |
It may be essentially the same issue, but the one @zerkms is having would be easier to reproduce and debug. The backtrace shows the exception was emitted during autoload registration, which is done before forking. |
While on the topic of PSL, I noticed that I sometimes (like 1 in 100 runs) get the following fatal error:
|
Here is a repro repository: https://github.com/zerkms/psalm-10706-repro |
Thanks, reproduced. |
This may resolve #10706, although I'm not exactly convinced it's the best way.
@zerkms would you mind trying with |
@weirdan that branch now runs fine: it does not crash and there are no unexpected warnings reported. |
@tm1000 @discordier @simonberger can you confirm as well? |
I can confirm as well. No crash and no new errors. Coming from My crash was:
|
For me it is still crashing but it seem to fix one problem. Here is the stack trace in case this shows anything new.
|
@simonberger your error seems to be the only one that's not an interface |
I do have the exact same error reported on slack for earlier versions on symfony slack some weeks ago: I can confirm that I do have the exact same issue as @simonberger and the only working psalm version (for me) is 5.18, everything higher than that leads to crashes. I was trying to extract a reproduction from our codebase into a dedicated repository but I haven't managed to reproduce the issue. I still think that this it might be related to the way how psalm is scanning files in a specific order. |
This may resolve #10706, although I'm not exactly convinced it's the best way.
@weirdan I tested the recent patch release. Sadly, it does not solve the problem regarding monolog reported in #10706 (comment) and #10706 (comment) |
@weirdan Sorry for the late reply, works for me now. |
It was fine in 5.21.1
file under test:
command:
Removing plugin changes nothing
psalm-autoload.php:
It totally has something to do with autoloader: as if I remove the first
autoload.php
- it then works fine.The text was updated successfully, but these errors were encountered: