evant / kotlin-inject

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

In some cases scope doesn't apply to provided dependency #405

Closed sergeshustoff closed 1 week ago

sergeshustoff commented 1 week ago

Can't reproduce in small test case, but here are the steps in large project:

interface Base 
class Impl : Base

@Provides
@Singleton
fun bind(impl: Impl): Base = impl

Then this Base is used in several other dependencies. Looks like in the cases with missing scope generated code always has private val base: Base generated for that component

sergeshustoff commented 1 week ago

Nevermind, that's javax.inject.Singleton sneaked into my imports