You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Please explain when this warning gets issued more clearly #14231
staticvoidMain(string[]args){varx=5;// Gives warningvary=Test();// Doesn't give warning}privatestaticintTest()=>5;
It seems like the compiler doesn't give this warning when the value is a function call.
I don't know if there is a specific reason for the compiler not to give the warning in that case or it's a bug in roslyn.
Activity
Youssef1313 commentedon Sep 6, 2019
A simpler example than yours is:
It seems like the compiler doesn't give this warning when the value is a function call.
I don't know if there is a specific reason for the compiler not to give the warning in that case or it's a bug in roslyn.
Youssef1313 commentedon Sep 6, 2019
dotnet/roslyn#17154
Youssef1313 commentedon Sep 6, 2019
This one is also related to that issue: dotnet/roslyn#15695
I think that docs should be updated. I've opened a PR to update this article.