-
Notifications
You must be signed in to change notification settings - Fork 10
Anvil does not generate dagger factory in some KSP multi-round cases #87
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
Comments
Can you create a minimally reproducible sample? Ideally a self-contained program. The one you linked is fairly nontrivial and I'm not really sure where to begin with it |
Sure, I will try to shrink it even further |
@ZacSweers I've updated the reproducer. What happens instead: public class DefaultListComponent_Factory_Impl(
private val delegateFactory: DefaultListComponent_Factory,
) : DefaultListComponent.Factory {
override fun invoke(onItemSelected: Function1<String, Unit>): DefaultListComponent =
delegateFactory.get(onItemSelected)
public companion object {
@JvmStatic
public fun create(delegateFactory: DefaultListComponent_Factory):
InjectProvider<DefaultListComponent.Factory> =
InstanceFactory.create(DefaultListComponent_Factory_Impl(delegateFactory))
@JvmStatic
public fun createFactoryProvider(delegateFactory: DefaultListComponent_Factory):
InternalProvider<DefaultListComponent.Factory> =
InstanceFactory.create(DefaultListComponent_Factory_Impl(delegateFactory))
}
}
But it does not generate the Removing the generated |
Uh oh!
There was an error while loading. Please reload this page.
Here's reproducer project: https://github.com/IlyaGulya/anvil-ksp-reproducer
If you run the
./gradlew :app:run
it will fail with following compilation error:Looking into the generated sources, there's indeed no

DefaultListComponent_Factory
:If I turn off the
anvil.generateDaggerFactories
and useksp(libs.dagger.compiler)
- everything starts working fine.If I remove the generated class
dep: ListComponentDependency
from theDefaultListComponent
constructor:Everything also works fine.
Seems that issue only present when we depend on the classes generated by another KSP processor.
The text was updated successfully, but these errors were encountered: