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

RSRP-298034: False 'Redundant cast to delegate'

$
0
0
Reporter Vladimir Reshetnikov (nikov) Vladimir Reshetnikov (nikov)
Created Apr 28, 2012 12:25:43 AM
Updated Apr 28, 2012 12:25:43 AM
Priority Normal
Type Bug
Fix versions No Fix versions
State Submitted
Assignee Unassigned
Subsystem No subsystem
Affected versions No Affected versions
Fixed in build No Fixed in build
using System;

class Program
{
    static void Main()
    {
        Action<string> a = (Action<object>) Console.WriteLine;
        Action<object> b = Console.WriteLine;
        Console.WriteLine(a == b); // True
    }
}


After removing allegedly redundant cast:

using System;

class Program
{
    static void Main()
    {
        Action<string> a = Console.WriteLine;
        Action<object> b = Console.WriteLine;
        Console.WriteLine(a == b); // False
    }
}

Viewing all articles
Browse latest Browse all 106942

Trending Articles