BUG Bad inspection says Expression is always false

Example which shows the problem:

        var keyToValue=new Dictionary<int, int> {{0, 0}, {1, 1}};
        var ids=new List<int> {1, 2, 3};
        var removed=false;
        foreach(var id in ids) {

ReSharper's inspection logic underlines the right-hand-side of the loop body assignment and says "Expression is always false".

This is definitely not the case for the example above. At the end of the loop, removed is true.

This inspection bug does not arise if I reverse the order of the bitwise-or operands:

        foreach(var id in ids) {

I've confirmed the bug in Resharper on Visual Studio 10.0.40219.1.

1 comment
Comment actions Permalink

Hello Naju
     Thank you very much for reporting this problem! I've logged it under http://youtrack.jetbrains.net/issue/RSRP-287532 in our bug-tracker and you're welcome to monitor its status.

Andrey Serebryansky

Senior Support Engineer

JetBrains, Inc


"Develop with pleasure!"


Please sign in to leave a comment.