mirror of
https://github.com/danog/psalm.git
synced 2024-11-26 20:34:47 +01:00
Flesh out callmap type
This commit is contained in:
parent
2ebf6a0ef5
commit
45eaea1ed9
@ -986,6 +986,13 @@ class CallChecker
|
||||
$return_type_candidate = Type::getString();
|
||||
} elseif (FunctionChecker::inCallMap($cased_method_id)) {
|
||||
$return_type_candidate = FunctionChecker::getReturnTypeFromCallMap($method_id);
|
||||
|
||||
$return_type_candidate = ExpressionChecker::fleshOutType(
|
||||
$project_checker,
|
||||
$return_type_candidate,
|
||||
$fq_class_name,
|
||||
$method_id
|
||||
);
|
||||
} else {
|
||||
if (MethodChecker::checkMethodVisibility(
|
||||
$method_id,
|
||||
|
@ -74,9 +74,12 @@ class MethodCallTest extends TestCase
|
||||
final class MyDate extends DateTimeImmutable {}
|
||||
|
||||
$today = new MyDate();
|
||||
$yesterday = $today->sub(new DateInterval("P1D"));',
|
||||
$yesterday = $today->sub(new DateInterval("P1D"));
|
||||
|
||||
$b = (new DateTimeImmutable())->modify("+3 hours");',
|
||||
'assertions' => [
|
||||
'$yesterday' => 'MyDate',
|
||||
'$b' => 'DateTimeImmutable',
|
||||
],
|
||||
],
|
||||
];
|
||||
|
Loading…
Reference in New Issue
Block a user