От: | _NN_ | www.nemerleweb.com | |
Дата: | 16.12.19 07:36 | ||
Оценка: |
struct S
{
public readonly ref int X => throw null;
public ref readonly int Y => throw null;
public ref int Z => throw null;
void f()
{
var s = new S();
ref readonly var x = ref s.X;
ref var x2 = ref s.X; // Ok
ref readonly var y = ref s.Y;
// ref var y2 = ref s.Y; // Error: s.Y is readonly
}
}