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

Don’t allow empty coercion on generic type params

Fixes #1590
This commit is contained in:
Matthew Brown 2019-05-02 00:19:56 -04:00
parent cacced782d
commit fbe10c1a1f

View File

@ -1591,21 +1591,19 @@ class TypeAnalyzer
continue;
}
if (!$input_param->isEmpty() &&
!self::isContainedBy(
$codebase,
$input_param,
$container_param,
$input_param->ignore_nullable_issues,
$input_param->ignore_falsable_issues,
$has_scalar_match,
$type_coerced,
$type_coerced_from_mixed,
$to_string_cast,
$type_coerced_from_scalar,
$allow_interface_equality
)
) {
if (!self::isContainedBy(
$codebase,
$input_param,
$container_param,
$input_param->ignore_nullable_issues,
$input_param->ignore_falsable_issues,
$has_scalar_match,
$type_coerced,
$type_coerced_from_mixed,
$to_string_cast,
$type_coerced_from_scalar,
$allow_interface_equality
)) {
$all_types_contain = false;
}
}