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

RSRP-297633: Warn for InvalidCastException for Enum.GetEnumValues() method

$
0
0
Reporter Vladimir Reshetnikov (nikov) Vladimir Reshetnikov (nikov)
Created Apr 26, 2012 3:25:29 AM
Updated Apr 26, 2012 3:37:40 AM
Priority Normal
Type Feature
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 A
{
    static void Main()
    {
        Foo(typeof(DayOfWeek));
    }

    static void Foo(Type e)
    {
        var values = (object[]) e.GetEnumValues(); // InvalidCastException
    }
}

Viewing all articles
Browse latest Browse all 106942

Trending Articles



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