Skip to content

Commit

Permalink
Merge pull request #42 from SignpostMarv/patch-2
Browse files Browse the repository at this point in the history
Amend unionizeIterables to support TList
  • Loading branch information
muglug committed Dec 17, 2019
2 parents 1dcd8ff + 0981c34 commit a577f90
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hooks/TestCaseHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,9 @@ private static function unionizeIterables(Codebase $codebase, Type\Union $iterab
$value_types[] = $type->getGenericValueType();
} elseif ($type instanceof Type\Atomic\TNamedObject || $type instanceof Type\Atomic\TIterable) {
list($key_types[], $value_types[]) = $codebase->getKeyValueParamsForTraversableObject($type);
} elseif ($type instanceof Type\Atomic\TList) {
$key_types[] = Type::getInt();
$value_types[] = $type->type_param;
} else {
throw new \RuntimeException('unexpected type');
}
Expand Down

0 comments on commit a577f90

Please sign in to comment.