CA2265: Do not compare Span<T> to null or default #123
Labels
design
is:bug
Something isn't working
notes:breaking-change
Has changes that will break backward compatibility
pri:normal
Milestone
This warning started happening when upgrading to the .NET 9 SDK (#122). The decision to use
default
as equivalent to specifyingnull
in the comparison goes against the grain of Microsoft's design practices. We should instead only consider thenull
for reference types and considerdefault(ReadOnlySpan<char>)
to be the same asReadOnlySpan<char>.Empty
. See:https://chatgpt.com/share/673e30d0-6a54-8005-be1f-0f6b207c5e1d
Since this is a breaking change from J2N 2.1, we won't be able to fix this until we have a major version bump.
The text was updated successfully, but these errors were encountered: