Please mark NativeArray<T> properties as readonly

We need to dispose native collections(e.g. NativeArray,NativeList) when we finished to use them.
And then, C# has language feature for this kind of context, “using”.
But currently, “using” doesn’t work well for when we are writing into their properties…(CS1654 error appears)
But in C#8 with Unity2020.2,we have solution for this issue.

 struct NativeCollectionWithReadOnlyProperties :IDisposable
    {
        public int NonReadOnlyProperty
        {
            get => default;
            set { }
        }
        public readonly int ReadOnlyProperty
        {
            get => default;
            set { }
        }
        public readonly int this[int i]
        {
            get => default;
            set { }
        }
        public readonly int Length
        {
            get => default;
            set { }
        }
        public readonly int Capacity
        {
            get => default;
            set { }
        }
        public void Dispose()
        {
          
        }
        public static void Sample()
        {
            using (var a = new NativeCollectionWithReadOnlyProperties())
            {
                a.NonReadOnlyProperty = 0; //Error:CS1654
                a.ReadOnlyProperty = 0; //OK!
                a[0] = 0; // OK!
                a.Length = 0; // OK!
                a.Capacity = 0; // OK!
            }
        }
    }

By just marking their properties “readonly”!
This will definitely improve usability of native collections.
Please.

I never came across a readonly property with a setter. Do you have a reference how this is supposed to work / what behavior can be expected?

https://docs.microsoft.com/dotnet/csharp/language-reference/proposals/csharp-8.0/readonly-instance-members
“readonly” member(property, method) ensures it never causes mutating.

This was proposed to prevent implicit copy while accessing member of non-“readonly” struct which is passed as in arguments.

in arguments are proposed to reducing copy to improve performance.
But accessing non-readonly properties of in arguments causes implicit copy every time, it would rather make worse performance.

So this feature also potentially improve performance of “Entities.ForEach”.

When we access dynamic buffer as read only in Entities.ForEach, we must mark it as in argument.
https://docs.unity3d.com/Packages/com.unity.entities@0.17/manual/ecs_entities_foreach.html
The document says that we should use in rather than passed-by-value to prevent copy, but it would rather make much copies for DynamicBuffer. This feature also solves this issue.