What does this mean in contrast to "unreachable code detected"?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
Here's an example of Resharper giving the cryptic "Heuristically unreachable code" warning:
It's an example of:
Heuristically unreachable means possibly unreachable code. Unreachable code is certainly unreachable.
Say you're deleting 2 different kinds of objects in a unit test and you want to use a try/catch for both types.
If you delete one, and then check to see if it was successful without properly casting using:
The "IsNull" may always be null because you casted obj1 incorrectly, or did something above the greyed out code incorrectly with obj1, the next try/catch will be greyed out.
Try fixing the thing you're trying to Assert.IsNull and once it's not always null or undefined, the greyed out code will be reachable.