anvil
anvil copied to clipboard
MembersInjectorGenerator will generate nullable type args for nullable injections
Perhaps this is correct behavior, but to my knowledge Dagger does not allow nulls to be passed through directly.
class Example @Inject constructor() {
@Inject
var injected: String? = null
}
Will result in member injection refs like this
public class Example_Factory(
private val param0: Provider<String?>
) : Factory<Example> {
public override fun get(): Example {
val instance = newInstance()
Example_MembersInjector.injectInjected(instance, param0.get())
return instance
}
}