Skip to content
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

Merged
merged 3 commits into from Feb 27, 2020

Conversation

wmdietl
Copy link
Member

@wmdietl wmdietl commented Feb 25, 2020

No description provided.

@@ -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) {
Copy link
Member

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;
Copy link
Member

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 smillst assigned wmdietl and unassigned smillst Feb 25, 2020
@wmdietl
Copy link
Member Author

wmdietl commented Feb 27, 2020

@smillst Thanks for the comments, I've addressed both.

@wmdietl wmdietl assigned smillst and unassigned wmdietl Feb 27, 2020
Copy link
Member

@smillst smillst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@smillst smillst merged commit 24bcf17 into typetools:master Feb 27, 2020
@wmdietl wmdietl deleted the issue3020 branch February 7, 2022 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants