Collection expression spread optimization using List<T>.AddRange(IEnumerable<T>)
skipped for ICollection<U>
when T
and U
are distinct types at compile-time only
#74894
Labels
Milestone
The collection expression spread optimization for
[.. x]
where the target type isList<T>
is skipped unnecessarily when:x
has a value type enumerator, andx
implementsICollection<U>
, andT
andU
are distinct types at compile-time but not at runtime (for instance,object
vs.object?
, or(int X, int Y)
vs.(int, int)
).See #74630
See #74769 (comment)
The text was updated successfully, but these errors were encountered: