-
-
Notifications
You must be signed in to change notification settings - Fork 352
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
review: fix: Use CtSuperAccess when implicitly accessing superclass field #5406
review: fix: Use CtSuperAccess when implicitly accessing superclass field #5406
Conversation
12a258a
to
ea9a0ad
Compare
@@ -364,12 +365,32 @@ <T> CtFieldAccess<T> createFieldAccess(SingleNameReference singleNameReference) | |||
if (ref.isStatic() && !ref.getDeclaringType().isAnonymous()) { | |||
va.setTarget(jdtTreeBuilder.getFactory().Code().createTypeAccess(ref.getDeclaringType(), true)); | |||
} else if (!ref.isStatic()) { | |||
va.setTarget(jdtTreeBuilder.getFactory().Code().createThisAccess(jdtTreeBuilder.getReferencesBuilder().getTypeReference(singleNameReference.actualReceiverType), true)); | |||
CtTypeReference<?> owningType = jdtTreeBuilder.getReferencesBuilder().getTypeReference(singleNameReference.actualReceiverType); | |||
if (enclosingClassHasFieldWithName(singleNameReference)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like singleNameReference.actualReceiverType == singleNameReference.fieldBinding().declaringClass
does the job too, however I'm wondering if actualReceiverType is what we want here for the owning type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@I-Al-Istannen can you resolve this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@I-Al-Istannen ping
fix: Do not print implicit super fix: Do not force-qualify implicit super elements
ea9a0ad
to
f8df670
Compare
f8df670
to
d9f360b
Compare
Closes #5221