@JvmSuppressWildcards is placed in the wrong position in generated membersInjector
See original GitHub issueGiven I have a class
class Box<T: CharSequence> @Inject constructor(val element: T)
and a second class where the first is injected:
class Fragment {
@Inject lateinit var box: Box<String>
then I see a members injector generated as:
class Fragment_MembersInjector(
private val param0: Provider<@JvmSuppressWildcards Box<String>>
) : MembersInjector<Fragment> {
but I think the position of @JvmSuppressWildcards is incorrect and should be instead
class Fragment_MembersInjector(
private val param0: Provider<Box<@JvmSuppressWildcards String>>
) : MembersInjector<Fragment> {
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
XX_MembersInjector.class is repeatedly generated in ... - GitHub
When dagger processes the other modules, and doesn't find that MembersInjector , it generates one, in each module. The duplicate generated ...
Read more >JvmSuppressWildcards - Kotlin Programming Language
Instructs compiler to generate or omit wildcards for type arguments corresponding to parameters with declaration-site variance, for example such as Collection< ...
Read more >Getting rid of Dagger 2 warning "Generating a MembersInjector"
in Dagger 2 when injecting dependencies into a class which extends from an abstract base class which also contains dependencies, Dagger shows a ......
Read more >JvmSuppressWildcards: The secret sauce to your sandwich ...
If generic types are exposed in Kotlin API, consider @JvmSuppressWildcards so that your Java consumer can compile successfully.
Read more >The anvil from square - GithubHelp
@JvmSuppressWildcards is placed in the wrong position in generated membersInjector. Given I have a class. class Box<T: CharSequence> @Inject constructor(val ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I’m gonna need to double check this, I was getting an error from KAPT in a downstream module that used a module where Anvil was generating factories. I’ll try it out as soon as I can
I can confirm this compiles fine. Closing the issue.