Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix specifying types for left side of null coalesce #1707

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

Merged
ondrejmirtes merged 1 commit into phpstan:1.8.x from rvanvelzen:type-specify-coalesce
Sep 6, 2022

Conversation

@rvanvelzen
Copy link
Contributor

@rvanvelzen rvanvelzen commented Sep 6, 2022

mvorisek reacted with heart emoji staabm, herndlm, and BackEndTea reacted with rocket emoji
Copy link
Member

@ondrejmirtes ondrejmirtes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Would you try deleting the if about Coalesce in TypeSpecifier on line 971 to see if it's still needed?
  2. Shouldn't this somehow work recursively even for $foo ?? $bar ?? $baz?

Copy link
Contributor Author

rvanvelzen commented Sep 6, 2022
edited
Loading

  1. Would you try deleting the if about Coalesce in TypeSpecifier on line 971 to see if it's still needed?

The bug-560 test fails without it

  1. Shouldn't this somehow work recursively even for $foo ?? $bar ?? $baz?

Without thinking too much about it it might, but I'd rather approach that separately - I haven't seen that kind of type narrowing in actual code before.

Copy link
Contributor Author

The test failure is unrelated as far as I can tell - broken by laravel/framework@d44c345

@rvanvelzen rvanvelzen marked this pull request as ready for review September 6, 2022 15:44
Copy link
Member

I agree, thank you very much 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

AltStyle によって変換されたページ (->オリジナル) /