mirror of
https://github.com/danog/psalm.git
synced 2024-11-26 20:34:47 +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;
|
||||
}
|
||||
|
||||
$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;
|
||||
} else {
|
||||
$redundant = false;
|
||||
|
@ -1350,7 +1350,6 @@ class ConditionalTest extends TestCase
|
||||
function takes_int(int $int) : void {}
|
||||
|
||||
if ($int == $string) {
|
||||
/** @psalm-suppress MixedArgument */
|
||||
takes_int($int);
|
||||
}',
|
||||
],
|
||||
|
Loading…
Reference in New Issue
Block a user