1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-23 06:11:25 +01:00
This commit is contained in:
Daniil Gentili 2022-07-27 20:08:00 +02:00
parent 1a4d68e53b
commit 68f3f246f5
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7

View File

@ -692,13 +692,15 @@ abstract class Type
$intersection_performed = true;
}
}
if ($type_1_atomic instanceof TIntRange && $type_2_atomic instanceof TIntRange) {
if ($type_1_atomic instanceof TInt && $type_2_atomic instanceof TInt) {
$intersection_atomic = TIntRange::intersectIntRanges(
$type_1_atomic,
$type_2_atomic
TIntRange::convertToIntRange($type_1_atomic),
TIntRange::convertToIntRange($type_2_atomic)
);
$intersection_performed = true;
return $intersection_atomic;
if ($intersection_atomic) {
$intersection_performed = true;
return $intersection_atomic;
}
}
if (null === $intersection_atomic) {
@ -731,6 +733,7 @@ abstract class Type
if (self::mayHaveIntersection($type_1_atomic, $codebase)
&& self::mayHaveIntersection($type_2_atomic, $codebase)
) {
/** @psalm-suppress TypeDoesNotContainType */
if ($type_1_atomic instanceof TNamedObject && $type_2_atomic instanceof TNamedObject) {
$first = $codebase->classlike_storage_provider->get($type_1_atomic->value);
$second = $codebase->classlike_storage_provider->get($type_2_atomic->value);