1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

Improve template handling robustness

This commit is contained in:
Matthew Brown 2019-06-25 09:06:23 -04:00
parent 5cb6fe14d7
commit d96246a824
3 changed files with 13 additions and 2 deletions

View File

@ -660,7 +660,15 @@ abstract class FunctionLikeAnalyzer extends SourceAnalyzer implements Statements
&& !TypeAnalyzer::isContainedBy(
$codebase,
$default_type,
$param_type
$param_type,
false,
false,
$has_scalar_match,
$type_coerced,
$type_coerced_from_mixed,
$to_string_cast,
$type_coerced_from_scalar,
true
)
) {
if (IssueBuffer::accepts(

View File

@ -127,7 +127,8 @@ class NewAnalyzer extends \Psalm\Internal\Analyzer\Statements\Expression\CallAna
$lhs_type_part->param_name,
$lhs_type_part->as_type
? new Type\Union([$lhs_type_part->as_type])
: Type::parseString($lhs_type_part->as)
: Type::parseString($lhs_type_part->as),
$lhs_type_part->defining_class
);
if ($new_type) {

View File

@ -620,6 +620,8 @@ class Populator
}
}
$parent_interface_storage->dependent_classlikes[strtolower($storage->name)] = true;
$parent_interfaces = array_merge($parent_interfaces, $parent_interface_storage->parent_interfaces);
$this->inheritMethodsFromParent($storage, $parent_interface_storage);