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

class-string<T of Something> should pass through literal-string #7823

Closed
simPod opened this issue Aug 21, 2022 · 4 comments · Fixed by phpstan/phpstan-src#1692
Closed

class-string<T of Something> should pass through literal-string #7823

simPod opened this issue Aug 21, 2022 · 4 comments · Fixed by phpstan/phpstan-src#1692
Labels
Milestone

Comments

@simPod
Copy link
Contributor

simPod commented Aug 21, 2022

Bug report

I'm getting ::class from generic input constraint to a parent class. That value then is not getting through literal-string check

Code snippet that reproduces the problem

https://phpstan.org/r/bf021dbe-1b1d-434f-811f-c6ede4beaa6a

Expected output

No error

@ondrejmirtes ondrejmirtes added this to the Easy fixes milestone Aug 22, 2022
@craigfrancis
Copy link

Kinda related to #332 for phpstan-doctrine, unfortunately I'm a little busy atm.

@ondrejmirtes
Copy link
Member

I disagree, you should type class-string<T>&literal-string intersection type.

@ondrejmirtes
Copy link
Member

Oh sorry, disregard my comment.

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants