A .Select() that I believe should work but it doesn't.
As title says, this is the script (not my real script just one made to show the issue):
With <GroupCollection> it says
But it works with <MatchCollection>, and I'm using .NET 8.0 so it isn't an issue about it not having generic interfaces or whatever, why is this happening when both have IEnumerable<T>.
This is their declarations
and
3 Replies
And yes I know I can do
But I really wanted to directly do
<GroupCollection>.Select(), but even if it's not possible I want to understand why it isn't, to me it seems like it should work.this is because GroupCollection implements multiple IEnumerables.
The compiler won't know which you want to use the
.Select() on.
You can do:
Where now it knows to use the
It implements multiple IEnumerables? 🤔
I see that indeed it does. That's...different.