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

Correct capture type variable method. #4875

Merged
merged 3 commits into from
Aug 12, 2021
Merged

Conversation

smillst
Copy link
Member

@smillst smillst commented Aug 9, 2021

Fixes #4852.

for (AnnotatedTypeVariable candidate : collection) {
first = candidate;
Copy link
Member

Choose a reason for hiding this comment

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

The current code returns the last, not first, candidate if no other matches.
I think this line should be if (first == null) { first = candidate; }.

@mernst mernst assigned smillst and unassigned mernst Aug 12, 2021
@mernst mernst merged commit 42ceca4 into typetools:master Aug 12, 2021
@mernst mernst deleted the issue4852 branch August 12, 2021 20:08
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.

Crash in AnnotatedTypeFactory.doesNotContainOthers
2 participants