1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 05:41:20 +01:00

Mixed value object-likes should still have string keys

This commit is contained in:
Brown 2019-08-27 14:40:40 -04:00
parent 4db8ca6a1d
commit 5a5629b835

View File

@ -181,7 +181,7 @@ class ObjectLike extends \Psalm\Type\Atomic
public function getGenericKeyType()
{
if ($this->had_mixed_value) {
return Type::getArrayKey();
return Type::getString();
}
$key_types = [];
@ -233,7 +233,7 @@ class ObjectLike extends \Psalm\Type\Atomic
public function getGenericArrayType()
{
if ($this->had_mixed_value) {
return new TNonEmptyArray([Type::getArrayKey(), Type::getMixed()]);
return new TNonEmptyArray([Type::getString(), Type::getMixed()]);
}
$key_types = [];