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:
parent
1208437b4c
commit
7f0dcae0b2
@ -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) {
|
||||
|
@ -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',
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user