Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is linked to the issue described in #731 and is just for demo purposes.
I have encountered this issue a few times with Farmer and do not know of an elegant solution.
Something like this can get you out in a pinch but it requires knowing what the builder is setting, which leaks the details. It's also just not very elegant.
An elegant solution would be if we could implement
For
andZero
in a way that allowed forif
in the CE but playing around with it for a few minutes did not work as expected. I have not worked with CEs for a while but not sure if this is even possible for a non-collection based CE.A simple solution (albeit quite some work) is to take in a value but add an optional parameter.
This matches what I usually do in builders in C# where boolean switching takes in a boolean with a default value.