1

I am using dagger dependency injection in my application,I use Qualifiers to inject my class with secondary constructor with Qualifier, But kotlin shows me compile time error says This annotation is not applicable to target value parameter
Example

@Qualifier
@Retention(AnnotationRetention.BINARY)
annotation class Car
open class BaseClass {

}

class TestingClass : BaseClass {

    @Inject
    constructor(@Car vehicle : Vehicle) : super() {

    }
}

In the above class am not able to inject the class Vehicle with @Car qualifier, Can anyone help me why this is not possible in secondary constructor of kotlin ?

Stack
  • 1,164
  • 1
  • 13
  • 26

0 Answers0