kotlin-inject
kotlin-inject copied to clipboard
Warn when scope annoation would have no effect
If I pass the dependency through the provide function using scope, then everything works correctly:
@MyScope
@Provides
fun provideFoo() = Foo()
generation:
foo = _scoped.get("com.example.Foo") {
provideFoo()
}
But if I declare a variable instead, then the scope is ignored:
@MyScope
abstract val foo: Foo
generation:
public override val foo: Foo
get() = Foo()
or:
@MyScope
abstract val lambdaFoo: () -> Foo
generation:
public override val lambdaFoo: Function0<Foo>
get() = {
Foo()
}