69
70 // CS-R1045: Explicit array size is redundant when initialized in place.
71 // https://deepsource.io/directory/analyzers/csharp/issues/CS-R1045
72 var odd = new int[] {1, 3, 5, 7, 9}; 73
74 Foo? f = null;
75 // CS-R1040: Null check can be collapsed and written as `f?.Bar == null`.
Consider dropping the array type and/or size when it is initialized explicitly using an initializer. This makes the syntax more concise.
var arr = new int[5] {1, 2, 3, 4, 5};
var arr = new[] {1, 2, 3, 4, 5};