-
Notifications
You must be signed in to change notification settings - Fork 651
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
Psalter wants to add "@result never" in void methods #8912
Comments
Hey @UlrichBoehm, can you reproduce the issue on https://psalm.dev ? |
It's reproducible as soon as you enable the setting "Force return types to be as tight as possible". |
I found these snippets: https://psalm.dev/r/40196637cc<?php
function checkForFoo(string $test): void
{
if (str_contains($test, 'foo')) {
throw new \Exception('No Foo here!');
}
}
|
Duplicate of #8862 Please create a PR to fix the implicit returns |
I found these snippets: https://psalm.dev/r/b0e397c14e<?php
function foo(): void
{
if (random_int(0, 1) === 1) {
return false;
}
}
https://psalm.dev/r/6ffb302b9e<?php
function foo(): void
{
if (random_int(0, 1) === 1) {
return 10;
}
}
|
* fix implicit void return type errors https://psalm.dev/r/b0e397c14e * fix void + never = null return type error https://psalm.dev/r/6f227ae9b9 * fixes vimeo#8912 and vimeo#8862
* fix implicit void return type errors https://psalm.dev/r/b0e397c14e * fix void + never = null return type error https://psalm.dev/r/6f227ae9b9 * fixes vimeo#8912 and vimeo#8862
* fix implicit void return type errors https://psalm.dev/r/b0e397c14e * fix void + never = null return type error https://psalm.dev/r/6f227ae9b9 * fixes vimeo#8912 and vimeo#8862
* fix implicit void return type errors https://psalm.dev/r/b0e397c14e * fix void + never = null return type error https://psalm.dev/r/6f227ae9b9 * fixes vimeo#8912 and vimeo#8862
Running the following code with psalter (dry-run, all issues) leads to the suggestion to add a doc block with "(at)return never" which is wrong.
FYI @kkmuffme
The text was updated successfully, but these errors were encountered: