dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
19.01k stars 4.03k forks source link

Have some way to skip nullable analysis when calling semantic model methods #68947

Open Youssef1313 opened 1 year ago

Youssef1313 commented 1 year ago

I have a scenario where I don't care about nullability when dealing with GetSymbolInfo. It would be good to have some way or flag to explicitly say "I don't care about nullability" which would make GetSymbolInfo faster.

CyrusNajmabadi commented 1 year ago

this has def come up before. the difficulty, as i remember it, is making this possible without making the order of operations observable.

jcouv commented 1 year ago

Tagging @333fred for thoughts on this

333fred commented 1 year ago

This has indeed come up before, but we've often been concerned that it's not actually perf benefit, since other components are going to want nullability info and we'd just have to do extra work to accommodate both views.