J
Jon Skeet [C# MVP]
Analysis ought to show that the return value is unused and optimize away the
cast. The function itself can't be optimized away because you've specified
NoInlining, of course, and I guess that prevents the JIT from inspecting it
for side effects and removing it, but there's no such barrier to eliminating
storage of the return value, is there?
True, true. I did at one point use the value, but removed it to keep
things simpler.
Would you expect a simple nullity test to be enough to prohibit that?
(Of course the return value *is* used when there's a cast, because the
cast might fail.)
Jon