-
Notifications
You must be signed in to change notification settings - Fork 668
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
Method __callStatic()
breaks asserts on 5.23
#10807
Comments
I found these snippets: https://psalm.dev/r/2a4ebd4d08<?php
class A
{
/** @psalm-assert non-empty-string $b */
public static function notEmptyStrOnly(string $b): void
{
if ('' === $b) throw new \Exception('');
}
public static function __callStatic() {}
}
/** @return non-empty-string */
function returnNonEmpty(string $b): string
{
A::notEmptyStrOnly($b);
return $b;
}
|
I assume not only asserts affected, but much more, however, I haven't checked the damaged area. |
Repro #10808 |
Reverting of #10704 has helped to pass the test. @issidorov please help if you have some time. :) |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
issidorov
pushed a commit
to issidorov/psalm
that referenced
this issue
Mar 11, 2024
issidorov
added a commit
to issidorov/psalm
that referenced
this issue
Mar 11, 2024
Resolved problem: ``` Psalm\Tests\AssertAnnotationTest::testAssertsAllongCallStaticMethodWork Psalm\Exception\CodeException: LessSpecificReturnStatement The type 'string' is more general than the declared return type 'non-empty-string' for returnNonEmpty ```
weirdan
pushed a commit
to issidorov/psalm
that referenced
this issue
Mar 11, 2024
weirdan
pushed a commit
to issidorov/psalm
that referenced
this issue
Mar 11, 2024
Resolved problem: ``` Psalm\Tests\AssertAnnotationTest::testAssertsAllongCallStaticMethodWork Psalm\Exception\CodeException: LessSpecificReturnStatement The type 'string' is more general than the declared return type 'non-empty-string' for returnNonEmpty ```
Fixed in #10812 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://psalm.dev/r/2a4ebd4d08
The text was updated successfully, but these errors were encountered: