Skip to content

Commit

Permalink
Simplify template bounds message
Browse files Browse the repository at this point in the history
Ref #3126
  • Loading branch information
muglug committed Apr 13, 2020
1 parent e17cfd8 commit 8533b86
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions src/Psalm/Internal/Analyzer/Statements/Expression/CallAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -3855,10 +3855,8 @@ public static function checkTemplateResult(
if ($union_comparison_result->type_coerced_from_mixed) {
if (IssueBuffer::accepts(
new MixedArgumentTypeCoercion(
'Could not reconcile upper and lower bounds '
. $upper_bound_type->getId() . ' and '
. $lower_bound_type->getId() . ' for template param '
. $template_name,
'Type ' . $lower_bound_type->getId() . ' should be a subtype of '
. $upper_bound_type->getId(),
$code_location,
$function_id
),
Expand All @@ -3869,10 +3867,8 @@ public static function checkTemplateResult(
} else {
if (IssueBuffer::accepts(
new ArgumentTypeCoercion(
'Could not reconcile upper and lower bounds '
. $upper_bound_type->getId() . ' and '
. $lower_bound_type->getId() . ' for template param '
. $template_name,
'Type ' . $lower_bound_type->getId() . ' should be a subtype of '
. $upper_bound_type->getId(),
$code_location,
$function_id
),
Expand All @@ -3884,10 +3880,8 @@ public static function checkTemplateResult(
} elseif ($union_comparison_result->scalar_type_match_found) {
if (IssueBuffer::accepts(
new InvalidScalarArgument(
'Could not reconcile upper and lower bounds '
. $upper_bound_type->getId() . ' and '
. $lower_bound_type->getId() . ' for template param '
. $template_name,
'Type ' . $lower_bound_type->getId() . ' should be a subtype of '
. $upper_bound_type->getId(),
$code_location,
$function_id
),
Expand All @@ -3898,10 +3892,8 @@ public static function checkTemplateResult(
} else {
if (IssueBuffer::accepts(
new InvalidArgument(
'Could not reconcile upper and lower bounds '
. $upper_bound_type->getId() . ' and '
. $lower_bound_type->getId() . ' for template param '
. $template_name,
'Type ' . $lower_bound_type->getId() . ' should be a subtype of '
. $upper_bound_type->getId(),
$code_location,
$function_id
),
Expand Down

0 comments on commit 8533b86

Please sign in to comment.