-
Notifications
You must be signed in to change notification settings - Fork 660
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@psalm-type loses return type when declaring callable #9496
Comments
I found these snippets: https://psalm.dev/r/4a64c9c24d<?php
/**
* @psalm-suppress UnusedClass
* @psalm-type TCallback1 callable():int
* @psalm-type TCallback2 (callable():int)
*/
final class Test {
/** @psalm-var TCallback1 */
private callable $callback1;
/** @psalm-var TCallback2 */
private callable $callback2;
/**
* @psalm-param TCallback1 $callback1
* @psalm-param TCallback2 $callback2
*/
public function __construct(callable $callback1, callable $callback2) {
/** @psalm-trace $callback1 */;
/** @psalm-trace $callback2 */;
$this->callback1 = $callback1;
$this->callback2 = $callback2;
}
}
|
Traced down to c72edef. |
ptomulik
added a commit
to ptomulik/psalm
that referenced
this issue
Mar 12, 2023
ptomulik
added a commit
to ptomulik/psalm
that referenced
this issue
Mar 12, 2023
ptomulik
added a commit
to ptomulik/psalm
that referenced
this issue
Mar 12, 2023
ptomulik
added a commit
to ptomulik/psalm
that referenced
this issue
Mar 13, 2023
ptomulik
added a commit
to ptomulik/psalm
that referenced
this issue
Mar 13, 2023
orklah
added a commit
that referenced
this issue
Mar 16, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://psalm.dev/r/4a64c9c24d
This changed somewhere between 5.7.7 and 5.8.0. For 5.7.7, both,
$callback1
and$callback2
are of typecallable():int
.The text was updated successfully, but these errors were encountered: