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

PHPStan type alias cache invalidation #10449

Closed
devnix opened this issue Jan 16, 2024 · 12 comments
Closed

PHPStan type alias cache invalidation #10449

devnix opened this issue Jan 16, 2024 · 12 comments
Labels
Milestone

Comments

@devnix
Copy link

devnix commented Jan 16, 2024

Bug report

I'm having the same problem as in #9622. I am not sure why the reproducer is not failing, but this change does not invalidate the cache:

/**
-* @phpstan-type Return non-empty-string
+* @phpstan-type Return int
 */

Code snippet that reproduces the problem

No response

Expected output

I would expect to invalidate the cache successfully

Did PHPStan help you today? Did it make you happy in any way?

I love that these little things enable me to type the return of my query bus in one place ❤️

Copy link

mergeable bot commented Jan 16, 2024

This bug report is missing a link to reproduction at phpstan.org/try.

It will most likely be closed after manual review.

@ondrejmirtes
Copy link
Member

Are you importing the alias in a different file?

@devnix
Copy link
Author

devnix commented Jan 17, 2024

Exactly, I forgot to specify that!

@ondrejmirtes
Copy link
Member

/cc @staabm Writing a failing test and fixing this is exactly up your alley 😊

@ondrejmirtes ondrejmirtes added this to the Easy fixes milestone Jan 17, 2024
@staabm
Copy link
Contributor

staabm commented Jan 17, 2024

@devnix I tried reproducing locally and did not succeed. could you create a full reproducer?

as far as I can tell, the result cache does already take the imports into account:
https://github.com/phpstan/phpstan-src/blob/f7fe57435785bf0c9a1129f94b0bdc58a496ec2a/src/Dependency/DependencyResolver.php#L50-L62C5

@devnix
Copy link
Author

devnix commented Jan 18, 2024

I'll try to reproduce it following this example: phpstan/phpstan-src@0fa6903

@staabm
Copy link
Contributor

staabm commented Jan 18, 2024

yep. its also fine if you setup a plain repo and I can convert it into the phpstan structure later on

@devnix
Copy link
Author

devnix commented Jan 29, 2024

I've been able to reproduce it, I'll post a repo now:

Grabacion.de.pantalla.desde.29-01-24.19.08.45.webm

@devnix
Copy link
Author

devnix commented Jan 29, 2024

https://github.com/devnix/phpstan-reproducer-10449 this should do it 😄

@staabm
Copy link
Contributor

staabm commented Jan 29, 2024

I was able to reproduce. will look into it now

@ondrejmirtes
Copy link
Member

Fixed phpstan/phpstan-src#2894

Copy link

github-actions bot commented Mar 2, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants