diff --git a/src/Psalm/Internal/Type/TypeTokenizer.php b/src/Psalm/Internal/Type/TypeTokenizer.php index 59beae3cf..341f12d05 100644 --- a/src/Psalm/Internal/Type/TypeTokenizer.php +++ b/src/Psalm/Internal/Type/TypeTokenizer.php @@ -443,6 +443,10 @@ class TypeTokenizer continue; } + if ($string_type_token[0] === 'func_num_args()') { + continue; + } + if (isset($type_aliases[$string_type_token[0]])) { $type_alias = $type_aliases[$string_type_token[0]]; diff --git a/tests/Template/ConditionalReturnTypeTest.php b/tests/Template/ConditionalReturnTypeTest.php index b2a7b7864..4f5b2f3fd 100644 --- a/tests/Template/ConditionalReturnTypeTest.php +++ b/tests/Template/ConditionalReturnTypeTest.php @@ -461,6 +461,21 @@ class ConditionalReturnTypeTest extends TestCase '$c' => 'string', ] ], + 'namespaceFuncNumArgs' => [ + '