Skip to content
This repository has been archived by the owner on Sep 3, 2023. It is now read-only.

Constructor Injection #18

Open
AyokunlePaul opened this issue Sep 3, 2019 · 0 comments
Open

Constructor Injection #18

AyokunlePaul opened this issue Sep 3, 2019 · 0 comments
Labels
enhancement New feature or request pre-1.0 Will no longer apply with 1.0+

Comments

@AyokunlePaul
Copy link

AyokunlePaul commented Sep 3, 2019

This is an issue to request for direct constructor injection.
Currently the @Inject functionality cannot be used on the constructor of a class.

Current behaviour:

data class DependencyA

data class MyClass constructors (
     val dependencyA: DependencyA
)
@Module
abstract class DependencyProvider {
     @Provides
     fun provideMyClass(dependencyA: DependencyA) = MyClass(dependencyA)
}

Expected behaviour:

data class MyClass @Inject constructor (
     dependencyA: DependencyA
)
@afollestad afollestad added the enhancement New feature or request label Sep 4, 2019
@afollestad afollestad added the pre-1.0 Will no longer apply with 1.0+ label Jan 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request pre-1.0 Will no longer apply with 1.0+
Projects
None yet
Development

No branches or pull requests

2 participants