Open kronic opened 1 year ago
Seems reasonable to me, perhaps support could be added for ArraySegment<>
as well to avoid boxing? Both of these can be worked around by casting to Span/Memory, but you lose the benefits of CallerArgumentExpression
at the same time.
Workaround for now could be using Guard.IsGreaterThan(immutableArray.Length, 0)
, which causes a somewhat useful error: System.ArgumentOutOfRangeException: Parameter "immutableArray.Length" (int) must be greater than <0>, was <0>.
This is probably not a breaking change as using ImmutableArray as-is currently errors due to ambiguous invocation between two interfaces.
Overview
Guard IsNotEmpty not support ImmutableArray
API breakdown
Usage example
Breaking change?
No
Alternatives
no
Additional context
No response
Help us help you
Yes, I'd like to be assigned to work on this item