mirror of
https://github.com/danog/psalm.git
synced 2024-12-04 10:38:49 +01:00
Merge pull request #6617 from orklah/nonspecific-literal-int
allow any integer range to be satisfied by TNonspecificLiteralInt
This commit is contained in:
commit
49abfcb71b
@ -5,6 +5,7 @@ namespace Psalm\Internal\Type\Comparator;
|
||||
use Psalm\Type\Atomic;
|
||||
use Psalm\Type\Atomic\TInt;
|
||||
use Psalm\Type\Atomic\TIntRange;
|
||||
use Psalm\Type\Atomic\TNonspecificLiteralInt;
|
||||
use Psalm\Type\Atomic\TPositiveInt;
|
||||
use Psalm\Type\Union;
|
||||
|
||||
@ -55,6 +56,10 @@ class IntegerRangeComparator
|
||||
return true;
|
||||
}
|
||||
|
||||
if (get_class($container_atomic_types['int']) === TNonspecificLiteralInt::class) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (get_class($container_atomic_types['int']) === TPositiveInt::class) {
|
||||
if ($input_type_part->isPositive()) {
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user