- Should we accept a general pattern following
..
in a slice_pattern? Answer: let's say yes for now. Allowing some nested patterns versus allowing all isn't a deep change. We can add that before shipping. - We should define the exact binding rules for any of these members and decide if we want to diverge from the range spec. Answer: we should stick to the same behavior as ranges. In short, we bind to indexers if available, otherwise special Slice method.
- Should extension methods play a role in sliceability? Answer: we may change that later (for slicing and slice pattern, thus transforming an error scenario into a working scenario) but should assume "no" for now (keep the existing rules from ranges).
- The pattern
{..}
tests forexpr.Length >= 0
. Should we omit such test (assuming Length is always non-negative)? Answer: this doesn't need to be spec'ed, it is an implementation detail. We are free to change/optimize what we emit for this case. I'd start without the optimization. We can add if we have time.
- should they be in scope at all? [jcouv:] They are not countable/indexable/rangeable by our current definitions..., so I'm leaning towards disallowing.
- lowering strategy for
array is {{1}}
That's only a question on the lowering strategy. Given array is {{1}} which one of the following is expected:
array.GetLength(0) == 1 && array.GetLength(1) == 1 && array[0, 0] is 1
array.GetLength(0) == 1 && array.GetLength(1) == 1 &&
array.GetLowerBound(0) is var b0 && array.GetLowerBound(1) is var b1 &&
array[b0 + 0, b1 + 0] is 1
- Should we allow length patterns with md arrays (probably no, unless we want to change the syntax to accept [0,0] etc) => I agree.
- Should we allow length patterns in nested lists? (probably no, there's no point to give a length when all of them must match) =>
- Should we allow slice patterns (without subpatterns) in a nested list? (this is possible unless we decide against it)
- Should we treat {} as an empty list in a nested pattern? (in that case new int[,] {{},{}} is {{},{}} returns true)
- formatting for slice-pattern (
..var
or.. var
?) - formatting for length-pattern (
is [> 0]
) - formatting for length-pattern on array type (
is string[] [> 0]
)
- records stack overflow
Activator.CreateInstance<T>() where T : struct
not invoking the parameterless ctor on .NET Framework
Third opportunistic topic:
ref
vs value.