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
Handle uninferred type parameter in array accesses (Fixes #3020) #3107
Conversation
@@ -224,8 +225,17 @@ public AnnotatedTypeMirror visitArrayAccess(ArrayAccessTree node, AnnotatedTypeF | |||
f.visitorState.setAssignmentContext(null); | |||
|
|||
AnnotatedTypeMirror type = f.getAnnotatedType(node.getExpression()); | |||
assert type instanceof AnnotatedArrayType; | |||
return ((AnnotatedArrayType) type).getComponentType(); | |||
if (type instanceof AnnotatedArrayType) { |
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.
Should this is TypeKinds instead of instanceof?
return ((AnnotatedArrayType) type).getComponentType(); | ||
} else if (type instanceof AnnotatedWildcardType) { | ||
// Clean-up after Issue #979. | ||
AnnotatedWildcardType wc = (AnnotatedWildcardType) 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.
Do you expect this to be an uninferred type argument? If so should we check that it is?
@smillst Thanks for the comments, I've addressed both. |
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.
Thanks!
No description provided.