Is this a hole in C# 8's NNR checks?
public struct V
{
private readonly double[] data;
public V(int size) => data = new double[size];
public int Length => data.Length;
}
var v = new V();
Console.WriteLine(v.Length);
I thought the compiler should have emitted a warning in this case, when using the default constructor. Yes, I know there are more cases when the "default constructor" is implicitly "used", but this case is the easiest one.
Is there anything that can be done in C# 8 about this?