diff --git a/src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php b/src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php index 5f4bcdf0f..3396deae0 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php +++ b/src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php @@ -1871,9 +1871,9 @@ class AssertionFinder return new IsType(new Atomic\TString()); case 'is_int': case 'is_integer': + case 'is_long': return new IsType(new Atomic\TInt()); case 'is_float': - case 'is_long': case 'is_double': case 'is_real': return new IsType(new Atomic\TFloat()); diff --git a/tests/TypeReconciliation/TypeTest.php b/tests/TypeReconciliation/TypeTest.php index 2573bc754..f287d66d2 100644 --- a/tests/TypeReconciliation/TypeTest.php +++ b/tests/TypeReconciliation/TypeTest.php @@ -1239,6 +1239,32 @@ class TypeTest extends TestCase strlen($s); }', ], + 'testIsIntAndAliasesTypeNarrowing' => [ + 'code' => ' [ + '$b===' => 'int', + '$c===' => 'int', + '$d===' => 'int', + ], + ], 'narrowWithCountToAllowNonTupleKeyedArray' => [ 'code' => '