-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
ElementImpl equality operator false negatives #59947
Comments
Two elements are equal only if they are identical, i.e. are from the same If there was a change to the file system, the analysis session is discarded, and elements are recreated. Try avoiding making changes to the file system while working on analysis of a codebase. |
@scheglov thanks for your answer. I'm using |
Hi @scheglov , I did some more digging on file changes. I mixed up repos, freezed isn't running on this code. According to Printing out the stack trace form the
Does this sound like a problem in analyzer, build_runner or injectable? |
Hi there,
This is a followup to Milad-Akarie/injectable#491, which I traced down to the dart analyzer, specifically commit 6494efb
The injectable library referenced above uses the analyzer to perform dependency injection at build time.
However, since the update to analyzer 7.2.0, generation randomly fails due to incorrect in-equality.
Unfortunately I couldn't generate a minimal reproducible example yet, but it looks like that elements are cached somewhere, sometimes discarded and re-instantiated.
Printing a StackTrace from
ElementImpl
constructor showed that elements created in stack trace [1] only are working, even if there are multiple invocations of the constructor.As soon as one invocations is using stack trace [2], generation fails.
Line numbers are from commit 5daaead
[1]
[2]
If you have any pointers, I'm happy to provide more infos
The text was updated successfully, but these errors were encountered: