Skip to content

Commit

Permalink
Only emit one error for erroneous array_map string closure types
Browse files Browse the repository at this point in the history
  • Loading branch information
muglug committed Jul 1, 2020
1 parent 4d73b25 commit 6c62e46
Showing 1 changed file with 5 additions and 0 deletions.
Expand Up @@ -700,6 +700,11 @@ private static function checkClosureTypeArgs(
return;
}

// we pick up errors for string closures elsewhere
if ($method_id === 'array_map' && $closure_type instanceof Type\Atomic\TString) {
return;
}

foreach ($closure_params as $i => $closure_param) {
if (!isset($array_arg_types[$i])) {
continue;
Expand Down

0 comments on commit 6c62e46

Please sign in to comment.