Skip to content
Permalink
Browse files

Commit actual fix

  • Loading branch information
muglug committed Jan 14, 2020
1 parent c77f2cd commit fcc7d896a0e1b40c9d4037cacecf34d622b1ffb4
Showing with 6 additions and 4 deletions.
  1. +6 −4 src/Psalm/Internal/Analyzer/TypeAnalyzer.php
@@ -751,19 +751,21 @@ public static function isAtomicContainedBy(
&& $input_type_part instanceof TArray
) {
$all_string_literals = true;
$all_int_literals = true;

$properties = [];

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

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

0 comments on commit fcc7d89

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