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

UnsupportedPropertyReferenceUsage cannot be suppressed #9825

Closed
mrsuh opened this issue May 26, 2023 · 4 comments · Fixed by #9828
Closed

UnsupportedPropertyReferenceUsage cannot be suppressed #9825

mrsuh opened this issue May 26, 2023 · 4 comments · Fixed by #9828
Labels

Comments

@mrsuh
Copy link

mrsuh commented May 26, 2023

<?php

class Test {
  public array $array = [];

  public function test(string $key): void {
    /** @psalm-suppress all */ 
    $stat = &$this->array[$key];
    /** @psalm-suppress ForbiddenCode */ 
    var_dump($stat);
  }
}
@psalm-github-bot
Copy link

Hey @mrsuh, can you reproduce the issue on https://psalm.dev ?

@mrsuh
Copy link
Author

mrsuh commented May 26, 2023

@psalm-github-bot
Copy link

I found these snippets:

https://psalm.dev/r/675057a770
<?php

class Test {
  public array $array = [];

  public function test(string $key): void {
    /** @psalm-suppress all */ 
    $stat = &$this->array[$key];
    /** @psalm-suppress ForbiddenCode */ 
    var_dump($stat);
  }
}
Psalm output (using commit b99857c):

ERROR: UnsupportedPropertyReferenceUsage - 8:5 - This reference cannot be analyzed by Psalm.

@orklah
Copy link
Collaborator

orklah commented May 26, 2023

@jack-worman could you take a look? MaybeAdd take a second param that should be the list of suppressed issues

@orklah orklah added the bug label May 26, 2023
jack-worman added a commit to jack-worman/psalm that referenced this issue May 26, 2023
@jack-worman jack-worman mentioned this issue May 26, 2023
jack-worman added a commit to jack-worman/psalm that referenced this issue May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants