Skip to content

Implemented function still considered abstract #375

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

Closed
vRallev opened this issue Apr 17, 2024 · 1 comment · Fixed by #376
Closed

Implemented function still considered abstract #375

vRallev opened this issue Apr 17, 2024 · 1 comment · Fixed by #376
Labels
bug Something isn't working

Comments

@vRallev
Copy link

vRallev commented Apr 17, 2024

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
Copy link
Author

vRallev commented Apr 17, 2024

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

@evant evant added the bug Something isn't working label Apr 17, 2024
vRallev added a commit to vRallev/kotlin-inject that referenced this issue Apr 17, 2024
The old mechanism depended on the order types were defined and processed them in order without respecting overridden functions. With the fix overridden functions get updated when collecting types.

Fixes evant#375
vRallev added a commit to vRallev/kotlin-inject that referenced this issue Apr 17, 2024
The old mechanism depended on the order types were defined and processed them in order without respecting overridden functions. With the fix overridden functions get updated when collecting types.

Fixes evant#375
evant pushed a commit to eygraber/kotlin-inject that referenced this issue Apr 18, 2024
The old mechanism depended on the order types were defined and processed them in order without respecting overridden functions. With the fix overridden functions get updated when collecting types.

Fixes evant#375
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants