Skip to content

UnevaluatedCode error not found when return occurs inside finally #2920

@evannoronha

Description

@evannoronha

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions