From 556d5625b5815dcc1b3733e59ecc99ddc9d0a819 Mon Sep 17 00:00:00 2001 From: Brown Date: Fri, 10 Apr 2020 00:10:31 -0400 Subject: [PATCH] Prevent Throwable being intersected with itself --- src/Psalm/Internal/Analyzer/Statements/Block/TryAnalyzer.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Psalm/Internal/Analyzer/Statements/Block/TryAnalyzer.php b/src/Psalm/Internal/Analyzer/Statements/Block/TryAnalyzer.php index d89495f79..d4d77634f 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Block/TryAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/Statements/Block/TryAnalyzer.php @@ -297,6 +297,7 @@ class TryAnalyzer $catch_class_type = new TNamedObject($fq_catch_class); if (version_compare(PHP_VERSION, '7.0.0dev', '>=') + && strtolower($fq_catch_class) !== 'throwable' && $codebase->interfaceExists($fq_catch_class) && !$codebase->interfaceExtends($fq_catch_class, 'Throwable') ) {