1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-21 21:31:13 +01:00

Alert user if !object assertion has issues

This commit is contained in:
Matthew Brown 2017-02-12 13:27:42 -05:00
parent d2e92131f5
commit d6c25c90b3

View File

@ -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'])) {