-
-
Notifications
You must be signed in to change notification settings - Fork 85
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Description
This seems to be a regression in 0.10.1: if a type has both nullable and non-nullable injection sites, compilation will fail with the following error:
error: [Metro/MissingBinding] Cannot find an @Inject constructor or @Provides-annotated function/property for: Foo
Foo is injected at
[AppGraph] View1(…, foo)
View1 is requested at
[AppGraph] AppGraph.view1
Similar bindings:
- Foo? (Nullable equivalent). Type: ConstructorInjected. Source: NullableNonNullableInject.kt:3:1Self-contained Reproducer
class Foo @Inject constructor()
class View1 @Inject constructor(foo: Foo)
class View2 @Inject constructor(foo: Foo?)
@DependencyGraph
interface AppGraph {
val view1: View1
val view2: View2
}
fun box(): String {
val graph = createGraph<AppGraph>()
val view1 = graph.view1
val view2 = graph.view2
return "OK"
}Metro version
0.10.1
Context
Initially reproduced in cash-android, and was later reproduced in the metro repo with a unit test.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working