Skip to content

Conversation

rvanvelzen
Copy link
Contributor

@rvanvelzen rvanvelzen commented Nov 4, 2022

{
$this->analyse([__DIR__ . '/data/bug-8284.php'], [
[
'Conditional return type references unknown parameter $callable.',
Copy link
Contributor

Choose a reason for hiding this comment

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

there is no @return tag on the replaceCallback() method so is this error message a bit misleading?
it looks like it's really a conditional parameter type?

Copy link
Member

Choose a reason for hiding this comment

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

The feature is actually "conditonal types", not "conditional return types" - it was implemented as a first thing after we released "conditional return types".

Copy link
Member

Choose a reason for hiding this comment

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

But for the sake of backward compatibility, let's leave it like this.

@ondrejmirtes ondrejmirtes merged commit 26bf11c into phpstan:1.9.x Nov 4, 2022
@ondrejmirtes
Copy link
Member

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unknown parameter name goes unnoticed in conditional type
3 participants