vimeo / psalm

A static analysis tool for finding errors in PHP applications
https://psalm.dev
MIT License
5.54k stars 660 forks source link

Setting values on a readonly WeakMap should not be an issue #10102

Open mathroc opened 1 year ago

mathroc commented 1 year ago

https://psalm.dev/r/e9bd694ee3

It's mutating the WeakMap but it's still the same object so this should be fine

psalm-github-bot[bot] commented 1 year ago

I found these snippets:

https://psalm.dev/r/e9bd694ee3 ```php w[new stdClass()] = 1; } } ``` ``` Psalm output (using commit 73ebe22): ERROR: InaccessibleProperty - 9:9 - C::$w is marked readonly ```