From afc2f18d18d9c22e3a97704a7208f3946a5a48a3 Mon Sep 17 00:00:00 2001 From: Matthew Brown Date: Sat, 15 Jun 2019 12:11:42 -0400 Subject: [PATCH] Allow ImplicitToStringCast when sending an object to scalar-accepting param --- src/Psalm/Internal/Analyzer/TypeAnalyzer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Psalm/Internal/Analyzer/TypeAnalyzer.php b/src/Psalm/Internal/Analyzer/TypeAnalyzer.php index bfe2fd3b0..681f8077a 100644 --- a/src/Psalm/Internal/Analyzer/TypeAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/TypeAnalyzer.php @@ -1188,7 +1188,7 @@ class TypeAnalyzer return false; } - if ($container_type_part instanceof TString + if (($container_type_part instanceof TString || $container_type_part instanceof TScalar) && $input_type_part instanceof TNamedObject ) { // check whether the object has a __toString method