{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/corefx/issues/8918","repository_url":"https://api.github.com/repos/dotnet/corefx","labels_url":"https://api.github.com/repos/dotnet/corefx/issues/8918/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/8918/comments","events_url":"https://api.github.com/repos/dotnet/corefx/issues/8918/events","html_url":"https://github.com/dotnet/corefx/pull/8918","id":157254001,"number":8918,"title":"Fix ValueTask<T>.ToString behavior with null results","user":{"login":"stephentoub","id":2642209,"avatar_url":"https://avatars.githubusercontent.com/u/2642209?v=3","gravatar_id":"","url":"https://api.github.com/users/stephentoub","html_url":"https://github.com/stephentoub","followers_url":"https://api.github.com/users/stephentoub/followers","following_url":"https://api.github.com/users/stephentoub/following{/other_user}","gists_url":"https://api.github.com/users/stephentoub/gists{/gist_id}","starred_url":"https://api.github.com/users/stephentoub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephentoub/subscriptions","organizations_url":"https://api.github.com/users/stephentoub/orgs","repos_url":"https://api.github.com/users/stephentoub/repos","events_url":"https://api.github.com/users/stephentoub/events{/privacy}","received_events_url":"https://api.github.com/users/stephentoub/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dotnet/corefx/labels/2%20-%20In%20Progress","name":"2 - In Progress","color":"CCCCCC"},{"url":"https://api.github.com/repos/dotnet/corefx/labels/cla-already-signed","name":"cla-already-signed","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-05-27T17:23:36Z","updated_at":"2016-05-27T20:21:52Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/8918","html_url":"https://github.com/dotnet/corefx/pull/8918","diff_url":"https://github.com/dotnet/corefx/pull/8918.diff","patch_url":"https://github.com/dotnet/corefx/pull/8918.patch"},"body":"ValueTask<T>'s ToString implementation doesn't special-case null results today, under the argument that it's just a wrapper for a T, and so if you do \"new ValueTask<string>((string)null).ToString()\", that should behave similarly to \"((string)null).ToString()).  But, of course, that means NullReferenceExceptions can emerge from calling ToString on a value type, and that code like \"default(ValueTask<SomeRefType>).ToString() will null ref, which is likely unexpected.\r\n\r\nThis commit changes the behavior of ToString to be less complicated and to handle nulls: if the ```ValueTask<T>``` has a non-null result (either from the ```Task<T>``` or the ```T```), the result's ToString is returned, otherwise string.Empty is returned.\r\n\r\ncc: @ellismg, @bartonjs, @ljw1004, @terrajobst, @KrzysztofCwalina "},"comment":{"url":"https://api.github.com/repos/dotnet/corefx/issues/comments/222244351","html_url":"https://github.com/dotnet/corefx/pull/8918#issuecomment-222244351","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/8918","id":222244351,"user":{"login":"terrajobst","id":5169960,"avatar_url":"https://avatars.githubusercontent.com/u/5169960?v=3","gravatar_id":"","url":"https://api.github.com/users/terrajobst","html_url":"https://github.com/terrajobst","followers_url":"https://api.github.com/users/terrajobst/followers","following_url":"https://api.github.com/users/terrajobst/following{/other_user}","gists_url":"https://api.github.com/users/terrajobst/gists{/gist_id}","starred_url":"https://api.github.com/users/terrajobst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/terrajobst/subscriptions","organizations_url":"https://api.github.com/users/terrajobst/orgs","repos_url":"https://api.github.com/users/terrajobst/repos","events_url":"https://api.github.com/users/terrajobst/events{/privacy}","received_events_url":"https://api.github.com/users/terrajobst/received_events","type":"User","site_admin":false},"created_at":"2016-05-27T20:21:52Z","updated_at":"2016-05-27T20:21:52Z","body":":+1:\r\n"}}
{"actor":{"display_login":"terrajobst"}}