mirror of
https://github.com/danog/psalm.git
synced 2025-01-21 21:31:13 +01:00
Fix regression – detect unused params with defaults again
This commit is contained in:
parent
1df3c9365c
commit
17a0ecb60e
@ -3201,7 +3201,7 @@ class ReflectorVisitor extends PhpParser\NodeVisitorAbstract implements PhpParse
|
||||
$param_type,
|
||||
new CodeLocation(
|
||||
$this->file_scanner,
|
||||
$fake_method ? $stmt : $param,
|
||||
$fake_method ? $stmt : $param->var,
|
||||
null,
|
||||
false,
|
||||
!$fake_method
|
||||
|
@ -2237,6 +2237,11 @@ class UnusedVariableTest extends TestCase
|
||||
);',
|
||||
'error_message' => 'UnusedClosureParam',
|
||||
],
|
||||
'unusedFunctionParamWithDefault' => [
|
||||
'<?php
|
||||
function foo(bool $b = false) : void {}',
|
||||
'error_message' => 'UnusedParam',
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user