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

Fix: phpdoc cache collision with identical aliases & variable names #471

Merged
merged 7 commits into from
Mar 13, 2021

Conversation

rainbow-alex
Copy link
Contributor

/** @var Foo $x */ in the global scope was cached once for all files, but it can have different semantics depending on the imports used in each file.

I can't provide a playground link because the bug requires multiple files. Please see the test coverage I added for an example.

@ondrejmirtes
Copy link
Member

The build failures might be solvable by bumping the cache version number here: https://github.com/phpstan/phpstan-src/pull/471/files#diff-34511260e902425b48cdc48e7434a8768e633d194e55a1273569d20b8310efceR219

@ondrejmirtes
Copy link
Member

This line needs to change: $cacheKey = sprintf('%s-phpdocstring-v7-generic-traits', $fileName);

@ondrejmirtes ondrejmirtes merged commit 978bcdf into phpstan:master Mar 13, 2021
@ondrejmirtes
Copy link
Member

Thank you!

@rainbow-alex rainbow-alex deleted the fix/phpdoc-cache-collision branch March 13, 2021 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants