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
PHP8 Mixed Type Not Being Detected As Nullable #4276
Comments
This is a bug. I'm also able to reproduce this under php 8.0 with non-literals - the intent was to make
|
TysonAndre
added
bug
A crash in Phan, a recent change causing incorrect analysis results, etc.
php8
Tracks changes to prepare for analyzing php 8 code
labels
Dec 1, 2020
TysonAndre
added a commit
to TysonAndre/phan
that referenced
this issue
Dec 1, 2020
- Work on fixing the false positives during redundant condition detection - Add a separate `non-null-mixed` type - TODO: Avoid regressions in inferred phpdoc type for array access - TODO: Continue to infer phpdoc `?mixed` type with a `?` in issue messages when combining mixed with null or converting mixed to nullable. (and emit PhanTypeArraySuspiciousNullable) For phan#4276
TysonAndre
added a commit
to TysonAndre/phan
that referenced
this issue
Dec 7, 2020
- Work on fixing the false positives during redundant condition detection - Add a separate `non-null-mixed` type - TODO: Avoid regressions in inferred phpdoc type for array access - TODO: Continue to infer phpdoc `?mixed` type with a `?` in issue messages when combining mixed with null or converting mixed to nullable. (and emit PhanTypeArraySuspiciousNullable) For phan#4276
TysonAndre
added a commit
that referenced
this issue
Dec 7, 2020
- Work on fixing the false positives during redundant condition detection - Add a separate `non-null-mixed` type - Continue to infer phpdoc `?mixed` type with a `?` in issue messages when combining mixed with null or converting mixed to nullable. (and emit PhanTypeArraySuspiciousNullable) For #4276 Support non-null-mixed Update tests and implementation to handle edge cases uncovered by the previous commit. Run phpcbf
TysonAndre
added a commit
to TysonAndre/phan
that referenced
this issue
Dec 9, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tested & confirmed on:
Summary
With the introduction of a 'mixed' type in PHP8's own language, but the core engine not supporting nullable mixed (?mixed), it seems that (at least) PhanCoalescingNeverNull now doesn't pick up internal functions that have a mixed return type can return null.
Example Code
Expected Output
No errors
Actual Output
The text was updated successfully, but these errors were encountered: