Open drinkthestars opened 3 years ago
could be related to https://github.com/google/dagger/issues/2855
I think this will likely be something that needs KSP as we probably will just see Foo
as an Integer
after kapt
. Added some labels but we can revisit in the future when KSP is done.
Sounds good, thank you!
I think this will likely be something that needs KSP as we probably will just see
Foo
as anInteger
afterkapt
. Added some labels but we can revisit in the future when KSP is done.
Is there a bug I can track related to "when KSP is done?"
The alpha version of KSP support was released with dagger 1.48, so I tested this again:
@JvmInline
value class PluginContext(val context: Context)
@Module
abstract class UiModule {
...
companion object {
@Provides
@PluginScope
fun providePluginContext(ctx: Context): PluginContext {
return PluginContext(ctx)
}
}
}
Just adding this provider (no requesters yet) ksp throws an error:
e: [ksp] java.lang.IllegalArgumentException: not a valid name: UiModule_Companion_ProvidePluginContext-wwunPCQFactory
To clarify, KSP is a prerequisite to fixing this, but is not itself the solution.
@Chang-Eric is this fixed with the current KSP implementation?
It is not fixed, as mentioned above. To clarify in case it is causing confusion, the current behavior is mixed, some cases work, some don't. This is because this is the behavior that existed due to kapt.
Injecting a
@JvmInline value class
fails in the following manner:Code:
Fails with:
Not sure if this is a bug, or if it's just impossible to support with
kapt
(i.e. needs something like KSP) 🤔. Thanks!