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

Always evaluate property calls on mixed methods

This commit is contained in:
Brown 2019-07-12 14:39:06 -04:00
parent 1208437b4c
commit 7f0dcae0b2
2 changed files with 12 additions and 0 deletions

View File

@ -585,6 +585,7 @@ class CallAnalyzer
|| $arg->value instanceof PhpParser\Node\Expr\StaticCall
|| $arg->value instanceof PhpParser\Node\Expr\Assign
|| $arg->value instanceof PhpParser\Node\Expr\ArrayDimFetch
|| $arg->value instanceof PhpParser\Node\Expr\PropertyFetch
|| $arg->value instanceof PhpParser\Node\Expr\Array_
) {
if (ExpressionAnalyzer::analyze($statements_analyzer, $arg->value, $context) === false) {

View File

@ -590,6 +590,17 @@ class MethodCallTest extends TestCase
}',
'error_message' => 'UndefinedMethod',
],
'complainAboutUndefinedPropertyOnMixedCall' => [
'<?php
class C {
/** @param mixed $a */
public function foo($a) : void {
/** @psalm-suppress MixedMethodCall */
$a->bar($this->d);
}
}',
'error_message' => 'UndefinedThisPropertyFetch',
],
];
}
}