Skip to content

Fix injecting generic types extending generic types #765

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 6 commits into from
Jan 15, 2025

Conversation

SentryMan
Copy link
Collaborator

@SentryMan SentryMan commented Jan 15, 2025

fixes #764


Edit: Noting that the issue was in the isAddGenericType() method that didn't recursively check meaning that it didn't detect generic parameter types beyond the "first level" of a generic type. With this fix it now checks recursively.

@SentryMan SentryMan added the bug Something isn't working label Jan 15, 2025
@SentryMan SentryMan added this to the 11.2 milestone Jan 15, 2025
@SentryMan SentryMan self-assigned this Jan 15, 2025
@SentryMan SentryMan enabled auto-merge (squash) January 15, 2025 15:24
@SentryMan
Copy link
Collaborator Author

@rbygrave please release an RC when you get time

@SentryMan SentryMan changed the title Fix Injecting generic ypes extending generic types Fix injecting generic types extending generic types Jan 15, 2025
return type.isGeneric()
&& type.kind() != TypeKind.TYPEVAR
&& (components.size() != 1 || components.get(0).kind() != TypeKind.WILDCARD)
&& components.stream()
.flatMap(TypeAppender::allComponentTypes)
Copy link
Contributor

Choose a reason for hiding this comment

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

Noting that this is effectively the fix here.

@SentryMan SentryMan merged commit b5e4caf into avaje:master Jan 15, 2025
7 checks passed
@SentryMan SentryMan deleted the generic-error branch January 16, 2025 02:28
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bugs when dependency using generic types
2 participants