1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 05:41:20 +01:00

Improve reporting of duplicate case statements

This commit is contained in:
Matthew Brown 2018-05-13 22:02:10 -04:00
parent 5c1726cece
commit 05c3d1ab03
2 changed files with 4 additions and 4 deletions

View File

@ -257,7 +257,7 @@ class SwitchChecker
$entry_clauses, $entry_clauses,
$case_clauses, $case_clauses,
$statements_checker, $statements_checker,
$stmt->cond, $case,
[] []
); );

View File

@ -610,7 +610,7 @@ class SwitchTypeTest extends TestCase
case 0: case 0:
echo "I never get here"; echo "I never get here";
}', }',
'error_message' => 'ParadoxicalCondition', 'error_message' => 'ParadoxicalCondition - src/somefile.php:7',
], ],
'impossibleCaseValue' => [ 'impossibleCaseValue' => [
'<?php '<?php
@ -626,7 +626,7 @@ class SwitchTypeTest extends TestCase
case "c": case "c":
echo "impossible"; echo "impossible";
}', }',
'error_message' => 'TypeDoesNotContainType', 'error_message' => 'TypeDoesNotContainType - src/somefile.php:11',
], ],
'impossibleCaseDefault' => [ 'impossibleCaseDefault' => [
'<?php '<?php
@ -642,7 +642,7 @@ class SwitchTypeTest extends TestCase
default: default:
echo "impossible"; echo "impossible";
}', }',
'error_message' => 'ParadoxicalCondition', 'error_message' => 'ParadoxicalCondition - src/somefile.php:11',
], ],
]; ];
} }