Quantcast
Channel: YouTrackReSharper (RSRP) - Bug and Issue Tracker
Viewing all articles
Browse latest Browse all 106942

RSRP-40822: Wrong 'Expression is always false' for user defined operators

$
0
0
Reporter Vladimir Reshetnikov (nikov) Vladimir Reshetnikov (nikov)
Created May 18, 2007 6:16:05 PM
Updated Dec 5, 2011 11:05:02 PM
Priority Normal
Type Bug
Fix versions Mirabile Futurum
State Submitted
Assignee Evgeny Pasynkov (pasynkov)
Subsystem No subsystem
Affected versions No Affected versions
Fixed in build No Fixed in build
using System;

class A
{
    static void Main()
    {
        new A().Foo();
    }

    public void Foo()
    {
        if(this == null) // Expression is always false
        {
            Console.WriteLine("Oops!");
        }
    }

    public static bool operator ==(A x, A y)
    {
        return true;
    }
    public static bool operator !=(A x, A y)
    {
        return false;
    }
}

Viewing all articles
Browse latest Browse all 106942

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>