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

ContributeSubComponent: Support returning Super Type #1070

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

esafirm
Copy link

@esafirm esafirm commented Nov 26, 2024

Description

Fixes #1044

This PR enables the ContributesSubcomponent.Factory to return the component super type.
The capability of returning component super type is available in @MergeComponent and is also supported in Dagger.

An example of this can be super useful is when we have a base factory.

interface BaseSubcomponent {
  interface Factory {
    fun createFactory(): BaseSubcomponent
  }
}

@ContributesSubcomponent.Factory 
interface Factory : BaseSubcomponent.Factory

This works as expected on 2.5.0-beta09 but later throws a compile error in 2.5.0-beta10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ContributesSubcomponent.Factory validation fails when the function is overridden
2 participants