You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<?phpfunctionwithVariadicParam(int$a, int$b, int ...$rest): int
{
thrownewRuntimeException();
}
/** @param Closure(int, int): int $f */functionint_int(Closure$f): void {}
/** @param Closure(int, int, int): int $f */functionint_int_int(Closure$f): void {}
/** @param Closure(int, int, int, int): int $f */functionint_int_int_int(Closure$f): void {}
/** @param Closure(int, int, int, string): int $f */functionint_int_int_string(Closure$f): void {}
// false positive: expected no issues here
int_int(withVariadicParam(...));
// ok: but that's because the number of parameters are the same.
int_int_int(withVariadicParam(...));
// ok: but last param actually does not type checked.
int_int_int_int(withVariadicParam(...));
// false negative: expected issue here
int_int_int_string(withVariadicParam(...));
https://psalm.dev/r/579db4822c
Actually I already have a fix for this problem.
But I don't know which branch to open PR.
master? v5?
The text was updated successfully, but these errors were encountered: