From c22fc15bfab75877ed14a47d247a72bd73fda242 Mon Sep 17 00:00:00 2001 From: Matthew Brown Date: Sun, 2 Oct 2016 22:00:05 -0400 Subject: [PATCH] clobber better --- src/Psalm/Type.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Psalm/Type.php b/src/Psalm/Type.php index eabffe274..dd7a1c213 100644 --- a/src/Psalm/Type.php +++ b/src/Psalm/Type.php @@ -492,11 +492,13 @@ abstract class Type // if we're merging an empty array with an object-like, clobber empty array if ($generic_type === 'array' + && isset($value_types['object-like']) && count($value_type) === 1 && isset($value_type['empty']) && count($key_type) === 1 - && isset($key_type['empty']) + && (isset($key_type['empty']) || isset($key_type['string'])) ) { + continue; }