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

RSRP-297467: Warn me about InvalidCastException when the object type is known from the provided typeof(...) expression

$
0
0
Reporter Vladimir Reshetnikov (nikov) Vladimir Reshetnikov (nikov)
Created Apr 25, 2012 1:52:51 AM
Updated Apr 26, 2012 3:41:35 AM
Priority Normal
Type Feature
Fix versions No Fix versions
State Submitted
Assignee Evgeny Pasynkov (pasynkov)
Subsystem No subsystem
Affected versions No Affected versions
Fixed in build No Fixed in build
using System;
using System.Collections;
using System.Data.Odbc;
using System.Diagnostics.Tracing;
using System.Reflection;

class A
{
    static void Main()
    {
        OdbcRowUpdatedEventHandler h = delegate { };
        ArrayList arr = new ArrayList();

        var c = (OdbcRowUpdatingEventHandler) Delegate.CreateDelegate(typeof(OdbcRowUpdatedEventHandler), h, "Invoke");
        var a = (EventAttribute) Enum.Parse(typeof(EventAttributes), "None");
        var b = (EventAttribute[]) arr.ToArray(typeof(EventAttributes));
    }
}

Viewing all articles
Browse latest Browse all 106942

Trending Articles



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