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

Could not get class storage for Traversable. #10682

Closed
3lvir4 opened this issue Feb 9, 2024 · 2 comments
Closed

Could not get class storage for Traversable. #10682

3lvir4 opened this issue Feb 9, 2024 · 2 comments

Comments

@3lvir4
Copy link

3lvir4 commented Feb 9, 2024

I was running psalm on a project after modifying some apis to return intersection types with traversable and got an error of the form:
Uncaught InvalidArgumentException: Could not get class storage for traversable in blablabla.

Maybe it is normal, I don't know. I find it strange since it is exactly one of the advertised usecases of this php feature.

I reproduced it here:
https://psalm.dev/r/17aef64aef

Is this a bug or something I missed ?

Copy link

I found these snippets:

https://psalm.dev/r/17aef64aef
<?php

use Traversable;

interface HasMap {
	function map(callable $fun): mixed;
}

function foo(): Traversable&HasMap {
	// something
}
Psalm encountered an internal error:

/vendor/vimeo/psalm/src/Psalm/Internal/Provider/ClassLikeStorageProvider.php: Could not get class storage for traversable

@weirdan
Copy link
Collaborator

weirdan commented Feb 10, 2024

Duplicate of #7520

@weirdan weirdan marked this as a duplicate of #7520 Feb 10, 2024
@weirdan weirdan closed this as not planned Won't fix, can't repro, duplicate, stale Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants