{"action":"closed","number":5069,"pull_request":{"url":"https://api.github.com/repos/dotnet/docs/pulls/5069","id":184810251,"html_url":"https://github.com/dotnet/docs/pull/5069","diff_url":"https://github.com/dotnet/docs/pull/5069.diff","patch_url":"https://github.com/dotnet/docs/pull/5069.patch","issue_url":"https://api.github.com/repos/dotnet/docs/issues/5069","number":5069,"state":"closed","locked":false,"title":"Composite formatting: fixed processing order description","user":{"login":"pkulikov","id":15279990,"avatar_url":"https://avatars1.githubusercontent.com/u/15279990?v=4","gravatar_id":"","url":"https://api.github.com/users/pkulikov","html_url":"https://github.com/pkulikov","followers_url":"https://api.github.com/users/pkulikov/followers","following_url":"https://api.github.com/users/pkulikov/following{/other_user}","gists_url":"https://api.github.com/users/pkulikov/gists{/gist_id}","starred_url":"https://api.github.com/users/pkulikov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pkulikov/subscriptions","organizations_url":"https://api.github.com/users/pkulikov/orgs","repos_url":"https://api.github.com/users/pkulikov/repos","events_url":"https://api.github.com/users/pkulikov/events{/privacy}","received_events_url":"https://api.github.com/users/pkulikov/received_events","type":"User","site_admin":false},"body":"The step 3c of the [composite formatting processing order](https://docs.microsoft.com/en-us/dotnet/standard/base-types/composite-formatting#processing-order) says:\r\n>For objects of other types, if a composite formatting is called with an `IFormatProvider` argument, its value (including a `null`, if no `IFormatProvider` object is supplied) is passed directly to the `IFormattable.ToString` implementation. Otherwise, a `CultureInfo` object that represents the current thread culture is passed to the `IFormattable.ToString` implementation.\r\n\r\nThe second sentence is redundant. The first sentence covers two complimentary cases: when an `IFormatProvider` argument is supplied and not supplied. I've moved no-`IFormatProvider` argument case into the corrected second sentence.\r\n\r\nI've used the following code to check the actual behavior (if you want to run it, just copy it to https://try.dot.net/):\r\n```csharp\r\nusing System;\r\nusing System.Globalization;\r\n\r\npublic class Program\r\n{\r\n  public static void Main()\r\n  {\r\n    CultureInfo.CurrentCulture = CultureInfo.GetCultureInfo(\"en-EN\");\r\n    var ghost = new Ghost();\r\n    Console.WriteLine($\"I'm a ghost: {ghost:ghost}\");\r\n  }\r\n\r\n  public class Ghost : IFormattable\r\n  {\r\n    public string ToString(string format, IFormatProvider formatProvider)\r\n    {\r\n      if (format == null) return null;\r\n      if (formatProvider == null) return \"not cultural ghost\";\r\n      return format.Equals(\"ghost\") ? \"~~~\" : null;\r\n    }\r\n  }\r\n}\r\n```\r\n\r\nOutput:\r\n```\r\nI'm a ghost: not cultural ghost\r\n```\r\n\r\n[The source code](https://github.com/dotnet/coreclr/blob/2250e2ae2d733934b3aba0a18706a546f9c5fac3/src/mscorlib/shared/System/Text/StringBuilder.cs#L1605) proves that `provider` is just passed to `IFormattable.ToString` method (it's `null` if it is not given to the calling `string.Format` method).\r\n","created_at":"2018-04-28T23:36:52Z","updated_at":"2018-04-30T15:08:12Z","closed_at":"2018-04-30T15:08:12Z","merged_at":"2018-04-30T15:08:12Z","merge_commit_sha":"bed5b11e66b881faecfedb7c16a0b14da3e94ce2","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/docs/pulls/5069/commits","review_comments_url":"https://api.github.com/repos/dotnet/docs/pulls/5069/comments","review_comment_url":"https://api.github.com/repos/dotnet/docs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/docs/issues/5069/comments","statuses_url":"https://api.github.com/repos/dotnet/docs/statuses/33e37c89b417de51c94f2749a241f722a684e7a0","head":{"label":"pkulikov:patch-1","ref":"patch-1","sha":"33e37c89b417de51c94f2749a241f722a684e7a0","user":{"login":"pkulikov","id":15279990,"avatar_url":"https://avatars1.githubusercontent.com/u/15279990?v=4","gravatar_id":"","url":"https://api.github.com/users/pkulikov","html_url":"https://github.com/pkulikov","followers_url":"https://api.github.com/users/pkulikov/followers","following_url":"https://api.github.com/users/pkulikov/following{/other_user}","gists_url":"https://api.github.com/users/pkulikov/gists{/gist_id}","starred_url":"https://api.github.com/users/pkulikov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pkulikov/subscriptions","organizations_url":"https://api.github.com/users/pkulikov/orgs","repos_url":"https://api.github.com/users/pkulikov/repos","events_url":"https://api.github.com/users/pkulikov/events{/privacy}","received_events_url":"https://api.github.com/users/pkulikov/received_events","type":"User","site_admin":false},"repo":{"id":127567104,"name":"docs","full_name":"pkulikov/docs","owner":{"login":"pkulikov","id":15279990,"avatar_url":"https://avatars1.githubusercontent.com/u/15279990?v=4","gravatar_id":"","url":"https://api.github.com/users/pkulikov","html_url":"https://github.com/pkulikov","followers_url":"https://api.github.com/users/pkulikov/followers","following_url":"https://api.github.com/users/pkulikov/following{/other_user}","gists_url":"https://api.github.com/users/pkulikov/gists{/gist_id}","starred_url":"https://api.github.com/users/pkulikov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pkulikov/subscriptions","organizations_url":"https://api.github.com/users/pkulikov/orgs","repos_url":"https://api.github.com/users/pkulikov/repos","events_url":"https://api.github.com/users/pkulikov/events{/privacy}","received_events_url":"https://api.github.com/users/pkulikov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pkulikov/docs","description":"This repository contains .NET Documentation.","fork":true,"url":"https://api.github.com/repos/pkulikov/docs","forks_url":"https://api.github.com/repos/pkulikov/docs/forks","keys_url":"https://api.github.com/repos/pkulikov/docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pkulikov/docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pkulikov/docs/teams","hooks_url":"https://api.github.com/repos/pkulikov/docs/hooks","issue_events_url":"https://api.github.com/repos/pkulikov/docs/issues/events{/number}","events_url":"https://api.github.com/repos/pkulikov/docs/events","assignees_url":"https://api.github.com/repos/pkulikov/docs/assignees{/user}","branches_url":"https://api.github.com/repos/pkulikov/docs/branches{/branch}","tags_url":"https://api.github.com/repos/pkulikov/docs/tags","blobs_url":"https://api.github.com/repos/pkulikov/docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pkulikov/docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pkulikov/docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/pkulikov/docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pkulikov/docs/statuses/{sha}","languages_url":"https://api.github.com/repos/pkulikov/docs/languages","stargazers_url":"https://api.github.com/repos/pkulikov/docs/stargazers","contributors_url":"https://api.github.com/repos/pkulikov/docs/contributors","subscribers_url":"https://api.github.com/repos/pkulikov/docs/subscribers","subscription_url":"https://api.github.com/repos/pkulikov/docs/subscription","commits_url":"https://api.github.com/repos/pkulikov/docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/pkulikov/docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/pkulikov/docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/pkulikov/docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/pkulikov/docs/contents/{+path}","compare_url":"https://api.github.com/repos/pkulikov/docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pkulikov/docs/merges","archive_url":"https://api.github.com/repos/pkulikov/docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pkulikov/docs/downloads","issues_url":"https://api.github.com/repos/pkulikov/docs/issues{/number}","pulls_url":"https://api.github.com/repos/pkulikov/docs/pulls{/number}","milestones_url":"https://api.github.com/repos/pkulikov/docs/milestones{/number}","notifications_url":"https://api.github.com/repos/pkulikov/docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pkulikov/docs/labels{/name}","releases_url":"https://api.github.com/repos/pkulikov/docs/releases{/id}","deployments_url":"https://api.github.com/repos/pkulikov/docs/deployments","created_at":"2018-03-31T20:06:41Z","updated_at":"2018-04-28T12:31:57Z","pushed_at":"2018-04-30T07:43:36Z","git_url":"git://github.com/pkulikov/docs.git","ssh_url":"git@github.com:pkulikov/docs.git","clone_url":"https://github.com/pkulikov/docs.git","svn_url":"https://github.com/pkulikov/docs","homepage":"https://docs.microsoft.com/dotnet","size":593870,"stargazers_count":0,"watchers_count":0,"language":"PowerShell","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"9c260bdcd6346b25a5e71749582a96a707601747","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":35890081,"name":"docs","full_name":"dotnet/docs","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/docs","description":"This repository contains .NET Documentation.","fork":false,"url":"https://api.github.com/repos/dotnet/docs","forks_url":"https://api.github.com/repos/dotnet/docs/forks","keys_url":"https://api.github.com/repos/dotnet/docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/docs/teams","hooks_url":"https://api.github.com/repos/dotnet/docs/hooks","issue_events_url":"https://api.github.com/repos/dotnet/docs/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/docs/events","assignees_url":"https://api.github.com/repos/dotnet/docs/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/docs/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/docs/tags","blobs_url":"https://api.github.com/repos/dotnet/docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/docs/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/docs/languages","stargazers_url":"https://api.github.com/repos/dotnet/docs/stargazers","contributors_url":"https://api.github.com/repos/dotnet/docs/contributors","subscribers_url":"https://api.github.com/repos/dotnet/docs/subscribers","subscription_url":"https://api.github.com/repos/dotnet/docs/subscription","commits_url":"https://api.github.com/repos/dotnet/docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/docs/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/docs/merges","archive_url":"https://api.github.com/repos/dotnet/docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/docs/downloads","issues_url":"https://api.github.com/repos/dotnet/docs/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/docs/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/docs/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/docs/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/docs/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/docs/deployments","created_at":"2015-05-19T15:13:32Z","updated_at":"2018-04-30T12:51:22Z","pushed_at":"2018-04-30T15:08:12Z","git_url":"git://github.com/dotnet/docs.git","ssh_url":"git@github.com:dotnet/docs.git","clone_url":"https://github.com/dotnet/docs.git","svn_url":"https://github.com/dotnet/docs","homepage":"https://docs.microsoft.com/dotnet","size":521633,"stargazers_count":1016,"watchers_count":1016,"language":"PowerShell","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2305,"mirror_url":null,"archived":false,"open_issues_count":428,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":2305,"open_issues":428,"watchers":1016,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/docs/pulls/5069"},"html":{"href":"https://github.com/dotnet/docs/pull/5069"},"issue":{"href":"https://api.github.com/repos/dotnet/docs/issues/5069"},"comments":{"href":"https://api.github.com/repos/dotnet/docs/issues/5069/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/docs/pulls/5069/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/docs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/docs/pulls/5069/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/docs/statuses/33e37c89b417de51c94f2749a241f722a684e7a0"}},"author_association":"CONTRIBUTOR","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"rpetrusha","id":10886961,"avatar_url":"https://avatars2.githubusercontent.com/u/10886961?v=4","gravatar_id":"","url":"https://api.github.com/users/rpetrusha","html_url":"https://github.com/rpetrusha","followers_url":"https://api.github.com/users/rpetrusha/followers","following_url":"https://api.github.com/users/rpetrusha/following{/other_user}","gists_url":"https://api.github.com/users/rpetrusha/gists{/gist_id}","starred_url":"https://api.github.com/users/rpetrusha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rpetrusha/subscriptions","organizations_url":"https://api.github.com/users/rpetrusha/orgs","repos_url":"https://api.github.com/users/rpetrusha/repos","events_url":"https://api.github.com/users/rpetrusha/events{/privacy}","received_events_url":"https://api.github.com/users/rpetrusha/received_events","type":"User","site_admin":false},"comments":1,"review_comments":1,"maintainer_can_modify":false,"commits":2,"additions":1,"deletions":1,"changed_files":1}}
{"actor":{"display_login":"rpetrusha"}}