Skip to content

Commit

Permalink
fix bug with class-string-map
Browse files Browse the repository at this point in the history
  • Loading branch information
kkmuffme committed Mar 12, 2024
1 parent 2344c1b commit 3bf9bcb
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,11 @@ public static function checkArgumentsMatch(
$has_unpacked_non_keyed_array = true;
}

$key_types = $array_type->type_params[0]->getAtomicTypes();
if (isset($array_type->type_params)) {

Check failure on line 835 in src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentsAnalyzer.php

View workflow job for this annotation

GitHub Actions / build

RedundantCondition

src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentsAnalyzer.php:835:25: RedundantCondition: Type list{Psalm\Type\Union, Psalm\Type\Union} for $array_type->type_params is always isset (see https://psalm.dev/122)
$key_types = $array_type->type_params[0]->getAtomicTypes();
} elseif ($array_type instanceof Type\Atomic\TClassStringMap) {
$key_types = Type::getNonFalsyString();
}

if ($array_type->type_params[0]->isString()) {
$named_args_was_used = true;
Expand Down

0 comments on commit 3bf9bcb

Please sign in to comment.