From 89bc501e17ae2d6c91f3b6496f699c3bbb773fc1 Mon Sep 17 00:00:00 2001 From: Matthew Brown Date: Mon, 3 Oct 2016 10:41:21 -0400 Subject: [PATCH] Make sure to set object-like property type if available --- src/Psalm/Checker/StatementsChecker.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Psalm/Checker/StatementsChecker.php b/src/Psalm/Checker/StatementsChecker.php index 13a1f8794..85b02b844 100644 --- a/src/Psalm/Checker/StatementsChecker.php +++ b/src/Psalm/Checker/StatementsChecker.php @@ -3945,6 +3945,9 @@ class StatementsChecker elseif ($type instanceof Type\Generic) { $stmt->inferredType = $type->type_params[$value_index]; } + elseif ($key_value && isset($type->properties[$key_value])) { + $stmt->inferredType = clone $type->properties[$key_value]; + } } elseif ($type->isString()) { if ($key_type) {