Why in code like below is the .NET compiler not able to establish that all code paths do return a value?
bool Test(bool param) {
bool test = true;
if
From Eric Lippert's blog:
The reachability analyzer is not very smart. It does not realize that there are only two possible control flows and that we've covered all of them with returns.
(The blog post is on switch
statements, but I guess the reachability analyzer isn't much smarter for if
statements.)