-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Make resolution of implements and extends types start with the parent… #4430
Make resolution of implements and extends types start with the parent… #4430
Conversation
… context of the class.
@@ -465,17 +465,23 @@ private ResolvedReferenceType toReferenceType(ClassOrInterfaceType classOrInterf | |||
// look for the qualified name (for example class of type Rectangle2D.Double) | |||
className = classOrInterfaceType.getScope().get().toString() + "." + className; | |||
} | |||
SymbolReference<ResolvedTypeDeclaration> ref = solveType(className); | |||
|
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.
Please comment on why, at this stage, type resolution should be delegated to the parent context.
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.
toReferenceType is used to resolve reference to "extends" and "implements" types. These types should not be resolved against e.g types with the same name defined within the class.
As per the test case I included --
class A extends B {
static class B ... {}
}
The B in "extends B" should not resolve to the B in "static class B"... Hence we should resolve based on the context containing the class.. Does this make sense?
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 meant adding comments to the code.
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.
Added, thanks
Thank you for this contribution. |
… context of the class.
Fixes #4427.