microsoft / referencesource

Source from the Microsoft .NET Reference Source that represent a subset of the .NET Framework
https://referencesource.microsoft.com/
MIT License
3.17k stars 1.27k forks source link

System.Linq doesn't throw exceptions in async-await Tasks. #164

Open cyberfrogg opened 2 years ago

cyberfrogg commented 2 years ago

Hi. I found an issue in System.Linq while working with async-await Tasks.

Issue:

When you use async-awaited Task when you using .Where() querries and IEnumerables and if you pass null array (example: MyNullArray.Where(x => x.state == true)) - thats will stop entire Task without throwing any exceptions. I could detect the stop only with the Visual Studio debugger. It showed: The thread 0x48e32be0 has exited with code 0 (0x0).

I think it is supposed to throw exceptions in console window. It's not critical issue, but it can be confusing

KalleOlaviNiemitalo commented 2 years ago

If you found a bug in .NET Framework then I believe https://developercommunity.visualstudio.com/ is the right place to report it. This repository is for publishing the existing code and not for changing how it works.