Skip to content
Permalink
Browse files

Always evaluate property calls on mixed methods

  • Loading branch information...
muglug committed Jul 12, 2019
1 parent 1208437 commit 7f0dcae0b2a498c9b0037fbed768c1599642c140
Showing with 12 additions and 0 deletions.
  1. +1 −0 src/Psalm/Internal/Analyzer/Statements/Expression/CallAnalyzer.php
  2. +11 −0 tests/MethodCallTest.php
@@ -585,6 +585,7 @@ private static function evaluateAribitraryParam(
|| $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 @@ function foo($a) : void {
}',
'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',
],
];
}
}

0 comments on commit 7f0dcae

Please sign in to comment.
You can’t perform that action at this time.