1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

Always analyse cast expressions

Fixes #3577
This commit is contained in:
Brown 2020-06-12 17:25:46 -04:00
parent 211f014356
commit 9bfe50b20a
2 changed files with 7 additions and 0 deletions

View File

@ -861,6 +861,7 @@ class ArgumentsAnalyzer
|| $arg->value instanceof PhpParser\Node\Expr\MethodCall
|| $arg->value instanceof PhpParser\Node\Expr\StaticCall
|| $arg->value instanceof PhpParser\Node\Expr\New_
|| $arg->value instanceof PhpParser\Node\Expr\Cast
|| $arg->value instanceof PhpParser\Node\Expr\Assign
|| $arg->value instanceof PhpParser\Node\Expr\ArrayDimFetch
|| $arg->value instanceof PhpParser\Node\Expr\PropertyFetch

View File

@ -334,6 +334,12 @@ class ToStringTest extends TestCase
}',
'error_message' => 'InvalidCast',
],
'alwaysEvaluateToStringVar' => [
'<?php
/** @psalm-suppress UndefinedFunction */
fora((string) $address);',
'error_message' => 'UndefinedGlobalVariable',
],
];
}
}