Closed lucabol closed 5 months ago
Repro:
using System; char[] chars = new char[10]; Span<char> sc = new Span<char>(chars); sc[0] = 'a';
This gives:
SpanBug.cs(5,1): error CS8331: Cannot assign to property 'this' or use it as the right hand side of a ref assignment because it is a readonly variable
This is likely because in zero lib Span.cs on line 70 the index is marked as readony:
Span.cs
readony
public ref readonly T this[int index]
I would submit a PR, but not sure how to test that my hypothesis is correct.
Repro:
This gives:
This is likely because in zero lib
Span.cs
on line 70 the index is marked asreadony
:I would submit a PR, but not sure how to test that my hypothesis is correct.