From 7298b41c456912d672257578ffe49b074fbe1d51 Mon Sep 17 00:00:00 2001 From: Matthew Brown Date: Mon, 12 Sep 2016 12:23:51 -0400 Subject: [PATCH] Do not throw access errors when array might be empty --- src/Psalm/Checker/StatementsChecker.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Psalm/Checker/StatementsChecker.php b/src/Psalm/Checker/StatementsChecker.php index eed81520c..d8247ffd8 100644 --- a/src/Psalm/Checker/StatementsChecker.php +++ b/src/Psalm/Checker/StatementsChecker.php @@ -3648,7 +3648,7 @@ class StatementsChecker } if ($stmt->dim) { - if (isset($stmt->dim->inferredType) && $key_type) { + if (isset($stmt->dim->inferredType) && $key_type && !$key_type->isEmpty()) { foreach ($stmt->dim->inferredType->types as $at) { if ($at->isMixed()) { // @todo emit issue