Skip to content

Conversation

@rvanvelzen
Copy link
Contributor

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?

@rvanvelzen
Copy link
Contributor Author

rvanvelzen commented Sep 6, 2022

  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.

@rvanvelzen rvanvelzen force-pushed the type-specify-coalesce branch from 0c261d3 to 48e3ee2 Compare September 6, 2022 15:27
@rvanvelzen
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
@ondrejmirtes
Copy link
Member

I agree, thank you very much 😊

@ondrejmirtes ondrejmirtes merged commit 0bfc5eb into phpstan:1.8.x Sep 6, 2022
@rvanvelzen rvanvelzen deleted the type-specify-coalesce branch September 7, 2022 04:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment