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

allow declaring functions and classLikes after a never-returning call #6828

Merged
merged 3 commits into from
Nov 5, 2021

Conversation

orklah
Copy link
Collaborator

@orklah orklah commented Nov 5, 2021

This fixes #6827

@orklah orklah added the release:fix The PR will be included in 'Fixes' section of the release notes label Nov 5, 2021
@weirdan
Copy link
Collaborator

weirdan commented Nov 5, 2021

Note that it doesn't extend to conditionally-defined symbols: https://3v4l.org/TZrHR

@orklah
Copy link
Collaborator Author

orklah commented Nov 5, 2021

No, it's just a side effect of being at top level on global scope. With your example, Psalm will still flag the if as unused

It also doesn't work in this case: https://3v4l.org/THj5q but here, Psalm won't pick up "UnevaluatedCode". I don't think it's a big issue though because it has nothing to do with never, it's just that PHP require the function to be above the call (unless it's at top level in global scope)

@orklah orklah merged commit 603fa65 into vimeo:master Nov 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:fix The PR will be included in 'Fixes' section of the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

don't emit issue for functions or class after a never-returning function call
2 participants