Skip to content
Permalink
Browse files

Don’t allow empty coercion on generic type params

Fixes #1590
  • Loading branch information...
muglug committed May 2, 2019
1 parent cacced7 commit fbe10c1a1fa9261c9eefc760b88faa0f38bdfa44
Showing with 13 additions and 15 deletions.
  1. +13 −15 src/Psalm/Internal/Analyzer/TypeAnalyzer.php
@@ -1591,21 +1591,19 @@ private static function isMatchingTypeContainedBy(
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;
}
}

0 comments on commit fbe10c1

Please sign in to comment.
You can’t perform that action at this time.