{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/5192","repository_url":"https://api.github.com/repos/Microsoft/visualfsharp","labels_url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/5192/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/5192/comments","events_url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/5192/events","html_url":"https://github.com/Microsoft/visualfsharp/pull/5192","id":331952570,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk0NTUzNzM0","number":5192,"title":"Require attributes to derive from System.Attribute","user":{"login":"vasily-kirichenko","id":873919,"node_id":"MDQ6VXNlcjg3MzkxOQ==","avatar_url":"https://avatars2.githubusercontent.com/u/873919?v=4","gravatar_id":"","url":"https://api.github.com/users/vasily-kirichenko","html_url":"https://github.com/vasily-kirichenko","followers_url":"https://api.github.com/users/vasily-kirichenko/followers","following_url":"https://api.github.com/users/vasily-kirichenko/following{/other_user}","gists_url":"https://api.github.com/users/vasily-kirichenko/gists{/gist_id}","starred_url":"https://api.github.com/users/vasily-kirichenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vasily-kirichenko/subscriptions","organizations_url":"https://api.github.com/users/vasily-kirichenko/orgs","repos_url":"https://api.github.com/users/vasily-kirichenko/repos","events_url":"https://api.github.com/users/vasily-kirichenko/events{/privacy}","received_events_url":"https://api.github.com/users/vasily-kirichenko/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":20,"created_at":"2018-06-13T11:24:13Z","updated_at":"2018-07-03T18:30:32Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/Microsoft/visualfsharp/pulls/5192","html_url":"https://github.com/Microsoft/visualfsharp/pull/5192","diff_url":"https://github.com/Microsoft/visualfsharp/pull/5192.diff","patch_url":"https://github.com/Microsoft/visualfsharp/pull/5192.patch"},"body":"This fixes https://github.com/Microsoft/visualfsharp/issues/4460\r\n\r\n![image](https://user-images.githubusercontent.com/873919/41348416-36b1be54-6f15-11e8-9fa4-2c75ec38938a.png)\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/comments/402252107","html_url":"https://github.com/Microsoft/visualfsharp/pull/5192#issuecomment-402252107","issue_url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/5192","id":402252107,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMjI1MjEwNw==","user":{"login":"cartermp","id":6309070,"node_id":"MDQ6VXNlcjYzMDkwNzA=","avatar_url":"https://avatars0.githubusercontent.com/u/6309070?v=4","gravatar_id":"","url":"https://api.github.com/users/cartermp","html_url":"https://github.com/cartermp","followers_url":"https://api.github.com/users/cartermp/followers","following_url":"https://api.github.com/users/cartermp/following{/other_user}","gists_url":"https://api.github.com/users/cartermp/gists{/gist_id}","starred_url":"https://api.github.com/users/cartermp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cartermp/subscriptions","organizations_url":"https://api.github.com/users/cartermp/orgs","repos_url":"https://api.github.com/users/cartermp/repos","events_url":"https://api.github.com/users/cartermp/events{/privacy}","received_events_url":"https://api.github.com/users/cartermp/received_events","type":"User","site_admin":false},"created_at":"2018-07-03T18:30:32Z","updated_at":"2018-07-03T18:30:32Z","author_association":"CONTRIBUTOR","body":"`GetCustomAttribute(s)` APIs don't fail for this:\r\n\r\n```fsharp\r\nopen System\r\n\r\n[<AttributeUsage(AttributeTargets.All, Inherited=false, AllowMultiple=true)>]\r\ntype Author(name: string) =\r\n    member val Version = 1.0 with get, set\r\n    member __.GetName() = name\r\n\r\n[<Author(\"P. Ackerman\")>]\r\ntype FirstClass() = class end\r\n\r\ntype SecondClass() = class end\r\n\r\n[<Author(\"P. Ackerman\"); Author(\"R. Koch\", Version=2.0)>]\r\ntype ThirdClass = class end\r\n\r\nlet print(t: Type) =\r\n    let attrs = Attribute.GetCustomAttributes(t) \r\n    for attr in attrs do\r\n        printfn \"%A\" attr\r\n\r\n[<EntryPoint>]\r\nlet main argv =\r\n    print typeof<FirstClass>\r\n    print typeof<SecondClass>\r\n    print typeof<ThirdClass>\r\n    0 // return an integer exit code\r\n```\r\n\r\nHowever, I don't think you can actually get the underlying information from the `Author` class unless you derive from `Attribute`. Casting is a compile error already.\r\n\r\nWhich is why I'm interested in what the runtiume _failure_ mentioned by @eiriktsarpalis in the original isue was. Because I don't think the .NET runtime actually requires something to inherit from `Attribute` for it to be treated as an attribute."}}
{"actor":{"display_login":"cartermp"}}