-
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
[vm_service] FieldRef.library.uri points to the wrong library for mixins #45093
Comments
This is a tricky edge case. Good news there is a way out without any VM (or more accurately mixin kernel transformer changes) |
Fyi @bkonyi |
After talking with @rmacnak-google, I think this is WAI as the mixed in field is owned by the class which the mixin was applied to, not the original mixin declaration. I've gone ahead and updated the documentation here to explain some of the situations where the location of |
Clears up confusion around function/field owner locations not necessarily representing where the function/field was actually declared (e.g., for functions and fields brought into a class via a mixin application). Fixes #45093 TEST=Documentation change Change-Id: Ideaf17ec99d005459c60a2dd88f72b3485b32664 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/240481 Reviewed-by: Ryan Macnak <rmacnak@google.com> Commit-Queue: Ben Konyi <bkonyi@google.com>
@bkonyi Unless I'm missing something, I don't agree with this getting closed. The root of the issue is that this behavior prevents mutating private properties of mixins as defined in the issue. To make the expression |
It's still possible to get access to the declaration location of the properties from their |
I see, thanks for sharing. I didn't know about this property |
Not a problem! :-) |
Consider:
When iterating over
Instance.fields
on aClass
instance, this will correctly report two_private
fields but:Mixin._private
'sFieldRef.owner.uri
will point tob.dart
instead ofa.dart
This is problematic because that can cause evaluations to be performed on
Class._private
instead ofMixin._private
.An example of such evaluation could be
classInstance._private++
The text was updated successfully, but these errors were encountered: