evant / kotlin-inject

Dependency injection lib for kotlin
Apache License 2.0
1.14k stars 51 forks source link

Implemented function still considered abstract #375

Closed vRallev closed 2 months ago

vRallev commented 2 months ago

Imagine this example:

interface Interface1 {
  fun string(): String
}

interface Interface2 : Interface1 {
  override fun string(): String = "abc"
}

@Component 
abstract class MyComponent1 : Interface1, Interface2

This fails with:

Cannot find an @Inject constructor or provider for: String

But if I change the order of the super types to the following, then the code compiles successfully:

@Component 
abstract class MyComponent1 : Interface2, Interface1
vRallev commented 2 months ago

I'm working on a fix for this right now.