1
0
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:
Brown 2020-09-14 10:58:36 -04:00
parent 1df3c9365c
commit 17a0ecb60e
2 changed files with 6 additions and 1 deletions

View File

@ -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

View File

@ -2237,6 +2237,11 @@ class UnusedVariableTest extends TestCase
);',
'error_message' => 'UnusedClosureParam',
],
'unusedFunctionParamWithDefault' => [
'<?php
function foo(bool $b = false) : void {}',
'error_message' => 'UnusedParam',
],
];
}
}