Quantcast
Viewing all articles
Browse latest Browse all 106942

RSRP-297632: Warn about InvalidCastException for GetCustomAttributes() method

Reporter Image may be NSFW.
Clik here to view.
Vladimir Reshetnikov (nikov)
Vladimir Reshetnikov (nikov)
Created Apr 26, 2012 3:20:44 AM
Updated Apr 26, 2012 3:20:44 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;
using System.Collections.Generic;

class A
{
    static void Main()
    {
        var attributes = (Attribute[]) typeof(List<>).GetCustomAttributes(false); // System.InvalidCastException: Unable to cast object of type 'System.Object[]' to type 'System.Attribute[]'.
    }
}

Viewing all articles
Browse latest Browse all 106942

Trending Articles