Skip to content
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

False positive impure call from a pure context when using attributes #10731

Closed
dragosprotung opened this issue Feb 20, 2024 · 1 comment · Fixed by #10734
Closed

False positive impure call from a pure context when using attributes #10731

dragosprotung opened this issue Feb 20, 2024 · 1 comment · Fixed by #10734

Comments

@dragosprotung
Copy link

See https://psalm.dev/r/f65db47829

I am not sure if this would be correct report for other attributes, but the \Override one should not trigger the error.

Copy link

I found these snippets:

https://psalm.dev/r/f65db47829
<?php

class base {
    /**
     * @psalm-pure
     */
    public function test(): void {}
}


class extending extends base {
     /**
     * @psalm-pure
     */
    #[\Override]
    public function test(): void {}
}
Psalm output (using commit c488d40):

ERROR: ImpureMethodCall - 15:7 - Cannot call an impure constructor from a pure context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants