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

UnevaluatedCode error not found when return occurs inside finally #2920

Closed
evannoronha opened this issue Mar 5, 2020 · 1 comment
Closed
Labels

Comments

@evannoronha
Copy link

Here, I would expect an UnevaluatedCode message, since the last return of this function will never be evaluated.

<?php

function noOp(): void {
  return; 
}
function doAThing(): bool {
  try {
    noOp();
  } finally {
    return true;
  }
  return false;
}

https://psalm.dev/r/d36dedcb6c

@psalm-github-bot
Copy link

I found these snippets:

https://psalm.dev/r/d36dedcb6c
<?php

function noOp(): void {
	return; 
}
function doAThing(): bool {
  try {
    noOp();
  } finally {
    return true;
  }
  return false;
}
Psalm output (using commit 09137b0):

No issues!

@muglug muglug added the bug label Mar 6, 2020
@muglug muglug closed this as completed in 6c7f89b Mar 15, 2020
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