{"action":"created","issue":{"url":"https://api.github.com/repos/xunit/xunit/issues/1458","repository_url":"https://api.github.com/repos/xunit/xunit","labels_url":"https://api.github.com/repos/xunit/xunit/issues/1458/labels{/name}","comments_url":"https://api.github.com/repos/xunit/xunit/issues/1458/comments","events_url":"https://api.github.com/repos/xunit/xunit/issues/1458/events","html_url":"https://github.com/xunit/xunit/issues/1458","id":258588966,"number":1458,"title":"Assert.Throws failed with System.InvalidProgramException","user":{"login":"lextm","id":425130,"avatar_url":"https://avatars1.githubusercontent.com/u/425130?v=4","gravatar_id":"","url":"https://api.github.com/users/lextm","html_url":"https://github.com/lextm","followers_url":"https://api.github.com/users/lextm/followers","following_url":"https://api.github.com/users/lextm/following{/other_user}","gists_url":"https://api.github.com/users/lextm/gists{/gist_id}","starred_url":"https://api.github.com/users/lextm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lextm/subscriptions","organizations_url":"https://api.github.com/users/lextm/orgs","repos_url":"https://api.github.com/users/lextm/repos","events_url":"https://api.github.com/users/lextm/events{/privacy}","received_events_url":"https://api.github.com/users/lextm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-09-18T19:12:07Z","updated_at":"2017-09-19T03:00:54Z","closed_at":null,"author_association":"NONE","body":"Similar to #1457.\r\n```\r\n    class Program\r\n    {\r\n        static void Main(string[] args)\r\n        {\r\n            Assert.Throws<ArgumentNullException>(() => SpanExtension.Test(null));\r\n        }\r\n    }\r\n\r\n    public static class SpanExtension\r\n    {\r\n        public static Span<byte> Test(this Span<byte> stream)\r\n        {\r\n            if (stream == null)\r\n                throw new ArgumentNullException(nameof(stream));\r\n            \r\n            return new Span<byte>();\r\n        }\r\n    }\r\n```\r\nThe console app would crash with\r\n```\r\nUnhandled Exception: Xunit.Sdk.ThrowsException: Assert.Throws() Failure\r\nExpected: typeof(System.ArgumentNullException)\r\nActual:   typeof(System.InvalidProgramException): Common Language Runtime detected an invalid program.\r\n   at Xunit.Assert.Throws(Type exceptionType, Exception exception) in C:\\projects\\xunit\\src\\xunit.assert\\Asserts\\ExceptionAsserts.cs:line 148\r\n   at Xunit.Assert.Throws[T](Func`1 testCode) in C:\\projects\\xunit\\src\\xunit.assert\\Asserts\\ExceptionAsserts.cs:line 41\r\n   at ConsoleApp1.Program.Main(String[] args) in F:\\sharpsnmplib\\ConsoleApp1\\Program.cs:line 17\r\n```"},"comment":{"url":"https://api.github.com/repos/xunit/xunit/issues/comments/330414548","html_url":"https://github.com/xunit/xunit/issues/1458#issuecomment-330414548","issue_url":"https://api.github.com/repos/xunit/xunit/issues/1458","id":330414548,"user":{"login":"lextm","id":425130,"avatar_url":"https://avatars1.githubusercontent.com/u/425130?v=4","gravatar_id":"","url":"https://api.github.com/users/lextm","html_url":"https://github.com/lextm","followers_url":"https://api.github.com/users/lextm/followers","following_url":"https://api.github.com/users/lextm/following{/other_user}","gists_url":"https://api.github.com/users/lextm/gists{/gist_id}","starred_url":"https://api.github.com/users/lextm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lextm/subscriptions","organizations_url":"https://api.github.com/users/lextm/orgs","repos_url":"https://api.github.com/users/lextm/repos","events_url":"https://api.github.com/users/lextm/events{/privacy}","received_events_url":"https://api.github.com/users/lextm/received_events","type":"User","site_admin":false},"created_at":"2017-09-19T03:00:54Z","updated_at":"2017-09-19T03:00:54Z","author_association":"NONE","body":"It seems to be related to https://github.com/dotnet/corefx/issues/21629"}}
{"actor":{"display_login":"lextm"}}