mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
loose comparisons of int with string shouldn't change change the int to empty-mixed
This commit is contained in:
parent
5f0332b678
commit
d94f7bd553
@ -1040,6 +1040,10 @@ final class SimpleAssertionReconciler extends Reconciler
|
|||||||
$string_types[] = $type;
|
$string_types[] = $type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$redundant = false;
|
||||||
|
} elseif ($type instanceof TInt && $assertion instanceof IsLooselyEqual) {
|
||||||
|
// don't change the type of an int for non-strict comparisons
|
||||||
|
$string_types[] = $type;
|
||||||
$redundant = false;
|
$redundant = false;
|
||||||
} else {
|
} else {
|
||||||
$redundant = false;
|
$redundant = false;
|
||||||
|
@ -1350,7 +1350,6 @@ class ConditionalTest extends TestCase
|
|||||||
function takes_int(int $int) : void {}
|
function takes_int(int $int) : void {}
|
||||||
|
|
||||||
if ($int == $string) {
|
if ($int == $string) {
|
||||||
/** @psalm-suppress MixedArgument */
|
|
||||||
takes_int($int);
|
takes_int($int);
|
||||||
}',
|
}',
|
||||||
],
|
],
|
||||||
|
Loading…
Reference in New Issue
Block a user