Colton Idle02/08/2021, 8:36 PM
Unfortunately it needs to be nullable as the provider is nullable, but I get an error saying Dagger does not support injection into private fields... which leads me to do
@Inject var taxes: Taxes? = null
and everything works. I could have sworn that this "workaround" wasn't needed for latest versions of dagger. Am I missing something?
@set:Inject var taxes: Taxes? = null
trevjones02/09/2021, 7:44 PM
type. The set qualifier seems brittle to me, because the type of the synthetic set is going to be nullable still and dagger is probably just not checking function injects for nullability. which should probably be considered a bug being that it is inconsistent with the field injection behavior. That said a manually written set function wrapped around a nullable private var could also work, I just think the Optional type wrapper more explicitly spells out the intent here. IMO nullable typed var != optional element because the semantics of why can vary wildly