diff --git a/src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php b/src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php index b2576a93b..b4bc3b029 100644 --- a/src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php @@ -660,7 +660,15 @@ abstract class FunctionLikeAnalyzer extends SourceAnalyzer implements Statements && !TypeAnalyzer::isContainedBy( $codebase, $default_type, - $param_type + $param_type, + false, + false, + $has_scalar_match, + $type_coerced, + $type_coerced_from_mixed, + $to_string_cast, + $type_coerced_from_scalar, + true ) ) { if (IssueBuffer::accepts( diff --git a/src/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php b/src/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php index 0d05622c5..cb2b6ba23 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php @@ -127,7 +127,8 @@ class NewAnalyzer extends \Psalm\Internal\Analyzer\Statements\Expression\CallAna $lhs_type_part->param_name, $lhs_type_part->as_type ? new Type\Union([$lhs_type_part->as_type]) - : Type::parseString($lhs_type_part->as) + : Type::parseString($lhs_type_part->as), + $lhs_type_part->defining_class ); if ($new_type) { diff --git a/src/Psalm/Internal/Codebase/Populator.php b/src/Psalm/Internal/Codebase/Populator.php index 02ca3d483..c68882f94 100644 --- a/src/Psalm/Internal/Codebase/Populator.php +++ b/src/Psalm/Internal/Codebase/Populator.php @@ -620,6 +620,8 @@ class Populator } } + $parent_interface_storage->dependent_classlikes[strtolower($storage->name)] = true; + $parent_interfaces = array_merge($parent_interfaces, $parent_interface_storage->parent_interfaces); $this->inheritMethodsFromParent($storage, $parent_interface_storage);