I have a variable defined before a try-finally block. The try block modifies this variable and then returns immediately. The finally block checks the value of this variable.
In this https://psalm.dev/r/805a07b110, I can get either "good" or "bad" depending on the parameter passed to the method. However, PSALM indicates that the variable is always false and that the new value is not used at all.
It seems that PSALM is confused because the try block contains a return statement.
PSALM does not seem to account for the fact that the finally block will execute even after a return statement in the try block.
I have a variable defined before a try-finally block. The try block modifies this variable and then returns immediately. The finally block checks the value of this variable.
In this https://psalm.dev/r/805a07b110, I can get either "good" or "bad" depending on the parameter passed to the method. However, PSALM indicates that the variable is always false and that the new value is not used at all.
It seems that PSALM is confused because the try block contains a return statement. PSALM does not seem to account for the fact that the finally block will execute even after a return statement in the try block.