-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Compile time error with KSP with Generics #4322
Comments
Hi, @nitinsethi86 , Thanks for reporting. I was able to reproduce. This should be due to an issue in the KSP library where a type defined as As a workaround I would try migrating the place where you inject |
@kuanyingchou Thanks for the reply. |
You can create a wrapper in Kotlin and inject that wrapper instead. Something like:
Note that due to another issue in an underlying library Dagger uses, the value of |
That works. Thanks. I will wait for the stable support of KSP in dagger. |
I am trying to test the waters with KSP (currently in aplha ) mainly because of the expected build time improvements.
I am seeing the below compile time error with ksp. The same setup works with kapt. Is this expected with the current version of 2.51.1?
app/build/generated/ksp/debug/java/com/ms/multimoduleapp/DaggerApplicationComponent.java:78: error: incompatible types: TestDelegate cannot be converted to ITestDelegate
LoginActivity_MembersInjector.injectTestDelegate(instance, new TestDelegate());
I am not quite sure if I understand the comment regarding generics in the below thread.
#2349 (comment)
Dagger version: 2.51.1
I have also attached the reproducer project in case its needed.
Reproducer_KSP.zip
The text was updated successfully, but these errors were encountered: