According the docs:
You can't declare a ref struct as a member of a class or a normal struct.
But I managed to compile and run this:
public ref struct RefStruct
{
public int value;
}
public class MyClass
{
public RefStruct Item => default;
}
...
MyClass c = new MyClass();
Console.WriteLine(c.Item.value);
Now RefStruct is a ref struct and it is a member of a class.
Is this statement wrong in some cases?
UPDATE Now the docs have been updated to a more precise description.