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

Weird behavior of static return type #2326

Closed
someniatko opened this issue Nov 12, 2019 · 2 comments
Closed

Weird behavior of static return type #2326

someniatko opened this issue Nov 12, 2019 · 2 comments
Labels

Comments

@someniatko
Copy link
Contributor

someniatko commented Nov 12, 2019

This emits error but shouldn't: https://psalm.dev/r/bf101787cd
Notice @return static<U> in ArrayCollection class.

This does not emit error: https://psalm.dev/r/69290b223c
All I did was I replaced static with ArrayCollection (self works too).

Related to doctrine/collections#211 (comment)

@muglug muglug added the bug label Nov 12, 2019
@muglug
Copy link
Collaborator

muglug commented Nov 12, 2019

Yeah, the bug is that @return static in a generic class should return Foo<SomeParam>, but I didn't account for @return static<T>

@someniatko
Copy link
Contributor Author

Thank you for explanation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants