Skip to content
Permalink
Browse files

Fix dumb

  • Loading branch information
muglug committed Jan 14, 2020
1 parent fcc7d89 commit c79a8ecbc20bba026e2c083bda9fdb810d92e8e6
Showing with 3 additions and 6 deletions.
  1. +3 −6 src/Psalm/Internal/Analyzer/TypeAnalyzer.php
@@ -750,22 +750,19 @@ public static function isAtomicContainedBy(
if ($container_type_part instanceof ObjectLike
&& $input_type_part instanceof TArray
) {
$all_string_literals = true;
$all_int_literals = true;
$all_string_int_literals = true;

$properties = [];

foreach ($input_type_part->type_params[0]->getAtomicTypes() as $atomic_key_type) {
if ($atomic_key_type instanceof TLiteralString || $atomic_key_type instanceof TLiteralInt) {
$properties[$atomic_key_type->value] = $input_type_part->type_params[1];
} elseif ($atomic_key_type instanceof TLiteralInt) {
$all_string_literals = false;
} else {
$all_int_literals = false;
$all_string_int_literals = false;
}
}

if ($all_string_literals || $all_int_literals) {
if ($all_string_int_literals) {
$input_type_part = new ObjectLike($properties);
}
}

0 comments on commit c79a8ec

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