From d6c25c90b3f1233eb41830c42d656b0902acb86f Mon Sep 17 00:00:00 2001 From: Matthew Brown Date: Sun, 12 Feb 2017 13:27:42 -0500 Subject: [PATCH] Alert user if !object assertion has issues --- src/Psalm/Checker/TypeChecker.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Psalm/Checker/TypeChecker.php b/src/Psalm/Checker/TypeChecker.php index ccb938c35..0fe840b03 100644 --- a/src/Psalm/Checker/TypeChecker.php +++ b/src/Psalm/Checker/TypeChecker.php @@ -570,7 +570,18 @@ class TypeChecker if ($non_object_types) { return new Type\Union($non_object_types); + } elseif (!$existing_var_type->from_docblock) { + if ($key && $code_location) { + if (IssueBuffer::accepts( + new FailedTypeResolution('Cannot resolve types for ' . $key, $code_location), + $suppressed_issues + )) { + // fall through + } + } } + + return Type::getMixed(); } if (in_array($new_var_type, ['!empty', '!null'])) {