-
Notifications
You must be signed in to change notification settings - Fork 360
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
False positive PhanTypeMismatchArgumentNullable on recursive call with bool argument #4550
Comments
This is known - Phan recursively analyzes calls. Among other things, it treats the parameter default differently, e.g. to catch passing It has a phpdoc type of Probably, that specifically could be changed for boolean assertions when there were no real types, but for conditions such as |
Getting a false positive
PhanTypeMismatchArgumentNulllable
on a scalar type, which is never null in a recursive call.Not sure, but it looks a bit like #4412, but this is not about PassByRef.
The example code is:
Using phan 5.2.1 with php8.
Only visible with
read_type_annotations = true
If the first argument is removed, the issue is gone.
If the call in getNewId is removed, the issue is gone.
If the $retry gets a real type hint of bool, the issue is gone.
If the if with $retry is removed/replaced, the issue is gone.
The text was updated successfully, but these errors were encountered: