amzn / kotlin-inject-anvil

Extensions for the kotlin-inject dependency injection framework
Apache License 2.0
274 stars 8 forks source link

Add support for me.tatarka.inject.generateCompanionExtensions #74

Closed eygraber closed 2 weeks ago

eygraber commented 2 weeks ago

I'm migrating a project using vanilla kotlin-inject, and I use me.tatarka.inject.generateCompanionExtensions = true for all of my components. When running with kotlin-inject-anvil I get the following error:

When you have the option me.tatarka.inject.generateCompanionExtensions=true you must declare a companion option on the component class for the extension function to apply to.
You can do so by adding 'companion object' to the class.

because the generated KotlinInject*Component classes don't declare a companion object.