ErrorProne.NET icon indicating copy to clipboard operation
ErrorProne.NET copied to clipboard

False warnings for ArraySegment<T>

Open helviett opened this issue 2 years ago • 1 comments

ArraySegment<T> is a readonly struct, but analyzer thinks it is not and always gives ESP06 warning.

helviett avatar Jun 01 '22 07:06 helviett

I believe I am having a similar problem, with System.Numerics.Vectors

I have projects that target frameworks netstandard2 and net6 ... as it happens, in net6 several System.* libraries expose APIs with readonly modifier, but the netstandard 2.0 counterparts don't

In other words, it's impossible to optimize code for both frameworks; What's an optimization in net6 is seen as a performance issue in netstandard2.0

Personally, I think the solution would be to allow disabling analysis on specific frameworks

vpenades avatar Jun 03 '22 07:06 vpenades