Using a simple type type
class A {
public int X, Y;
}
with lens intializers, you can write
var a = new A { X=0, Y=0 };
But the compiler also accepts the following:
var a = new A { X=0, Y=0, };
Same for int[] v = new int[] { 1, 2, };
It looks a little strange ... Have they forgot to abandon the extra "," in the compiler or is there a deeper meaning?
source
share