Root functions should allow nullable args#144
Root functions should allow nullable args#144adamhathcock wants to merge 1 commit intoDevTeam:masterfrom
Conversation
|
I can retarget this PR when dev is made again |
|
Thanks for the PR. Could you please describe the concrete scenario where a root argument needs to be passed as I intentionally avoided supporting this so far for a couple of reasons:
For optional data, I would currently expect users to model it explicitly, for example with a wrapper/options type, a domain-specific abstraction, or a default value, depending on the scenario. I’m open to supporting this if there is a strong use case, but I would like to understand the intended pattern first and make sure it does not break Pure.DI’s expectation that injected dependencies are non-null unless explicitly modeled otherwise. |
|
Real quick: I'm making a factory class that takes a nullable string and doing something in the factory method. Depending on the value stuff is done and a new class with some injected dependencies is made. You're right that dependencies themselves shouldn't be nullable but passed args can be. I can give more details and stuff on Tuesday. Typing on mobile now. Thanks! |
when doing
.RootArgI noticed nullable values weren't being respected/propagated. This PR should allow that.