1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 12:24:49 +01:00

Fix #4760 - prevent unpacked vars from breaking call when checking unitialised properties

This commit is contained in:
Matt Brown 2020-12-03 10:12:54 -05:00 committed by Daniil Gentili
parent 9c5cc02f90
commit eba91f741b
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
2 changed files with 13 additions and 1 deletions

View File

@ -1328,7 +1328,7 @@ class ClassAnalyzer extends ClassLikeAnalyzer
return new PhpParser\Node\Arg(
new PhpParser\Node\Expr\Variable($param->name, $attributes),
false,
false,
$param->is_variadic,
$attributes
);
},

View File

@ -2179,6 +2179,18 @@ class PropertyTypeTest extends TestCase
}
}'
],
'noErrorForSplatArgs' => [
'<?php
class Foo {
protected array $b;
protected function __construct(?string ...$bb) {
$this->b = $bb;
}
}
class Bar extends Foo {}'
],
];
}