Skip to content
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

Anvil drops covariance hint for assisted injection factories #388

Closed
vRallev opened this issue Oct 15, 2021 · 0 comments · Fixed by #391
Closed

Anvil drops covariance hint for assisted injection factories #388

vRallev opened this issue Oct 15, 2021 · 0 comments · Fixed by #391
Labels
bug Something isn't working dagger factory Happens when generateDaggerFactories is set to true

Comments

@vRallev
Copy link
Collaborator

vRallev commented Oct 15, 2021

class MonitorWaiter @AssistedInject constructor(
  @Main private val mainScheduler: Scheduler,
  @Assisted private val waitForMonitor: Observable<Class<out SellerScreenMonitor>>,
  @Assisted private val currentMonitor: Observable<SellerScreenMonitor>,
  @Assisted private val getCurrentMonitor: () -> SellerScreenMonitor
) {
  @AssistedFactory
  interface Factory {
    fun create(
      waitForMonitor: Observable<Class<out SellerScreenMonitor>>,
      currentMonitor: Observable<SellerScreenMonitor>,
      getCurrentMonitor: () -> SellerScreenMonitor
    ): MonitorWaiter
  }
}

This will fail with Anvil, but be successful with Kapt.

@vRallev vRallev added bug Something isn't working dagger factory Happens when generateDaggerFactories is set to true labels Oct 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dagger factory Happens when generateDaggerFactories is set to true
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant