← Back to context

Comment by pjc50

3 days ago

I did try that initially and got

    <source>(5,1): error CS9176: There is no target type for the collection expression.

.. which I took to mean that, because .Select is an extension method on IEnumerable, the engine was unable to infer whether the collection should be a list, array, or some other type of collection.

It seems reasonable to have it default to Array if it's ambiguous, maybe there's a downside I'm not aware of.