1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 05:41:20 +01:00

Don’t check function return types if it has template types

This commit is contained in:
Matthew Brown 2017-02-09 22:54:06 -05:00
parent 5e8a40a5a1
commit 04d9854ce0

View File

@ -330,15 +330,12 @@ class FileChecker extends SourceChecker implements StatementsSource
/** @var string */
$method_id = $function_checker->getMethodId();
$return_type = FunctionChecker::getFunctionReturnType(
$method_id,
$this->file_path
);
$function_storage = FunctionChecker::getStorage($method_id, $this->file_path);
$return_type_location = FunctionChecker::getFunctionReturnTypeLocation(
$method_id,
$this->file_path
);
if (!$function_storage->has_template_return_type) {
$return_type = $function_storage->return_type;
$return_type_location = $function_storage->return_type_location;
$function_checker->verifyReturnType(
false,
@ -348,6 +345,7 @@ class FileChecker extends SourceChecker implements StatementsSource
);
}
}
}
if (!$preserve_checkers) {
$this->class_checkers_to_analyze = [];