{"action":"opened","number":24118,"pull_request":{"url":"https://api.github.com/repos/angular/angular/pulls/24118","id":190474388,"html_url":"https://github.com/angular/angular/pull/24118","diff_url":"https://github.com/angular/angular/pull/24118.diff","patch_url":"https://github.com/angular/angular/pull/24118.patch","issue_url":"https://api.github.com/repos/angular/angular/issues/24118","number":24118,"state":"open","locked":false,"title":"fix(core): refine Injector.get declaration to infer correct return type","user":{"login":"ts2do","id":723753,"avatar_url":"https://avatars2.githubusercontent.com/u/723753?v=4","gravatar_id":"","url":"https://api.github.com/users/ts2do","html_url":"https://github.com/ts2do","followers_url":"https://api.github.com/users/ts2do/followers","following_url":"https://api.github.com/users/ts2do/following{/other_user}","gists_url":"https://api.github.com/users/ts2do/gists{/gist_id}","starred_url":"https://api.github.com/users/ts2do/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ts2do/subscriptions","organizations_url":"https://api.github.com/users/ts2do/orgs","repos_url":"https://api.github.com/users/ts2do/repos","events_url":"https://api.github.com/users/ts2do/events{/privacy}","received_events_url":"https://api.github.com/users/ts2do/received_events","type":"User","site_admin":false},"body":"These changes address an overload resolution issue whereby Injector.get\r\ncalls would resolve to the deprecated overload, disabling all type\r\nchecks with an 'any' return type.\r\n\r\nBREAKING CHANGE:\r\nAny code now succeeding type checks will fail if the return type was not\r\nused carefully.\r\n\r\n## PR Checklist\r\nPlease check if your PR fulfills the following requirements:\r\n\r\n- [x] The commit message follows our guidelines: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit\r\n- [x] Tests for the changes have been added (for bug fixes / features)\r\n- [x] Docs have been added / updated (for bug fixes / features)\r\n\r\n\r\n## PR Type\r\nWhat kind of change does this PR introduce?\r\n\r\n<!-- Please check the one that applies to this PR using \"x\". -->\r\n```\r\n[x] Bugfix\r\n[ ] Feature\r\n[ ] Code style update (formatting, local variables)\r\n[ ] Refactoring (no functional changes, no api changes)\r\n[ ] Build related changes\r\n[ ] CI related changes\r\n[ ] Documentation content changes\r\n[ ] angular.io application / infrastructure changes\r\n[ ] Other... Please describe:\r\n```\r\n\r\n## What is the current behavior?\r\n<!-- Please describe the current behavior that you are modifying, or link to a relevant issue. -->\r\nGiven `x` of type `Type<T>|InjectionToken<T>` and `y` of type `U` (excluding `THROW_IF_NOT_NULL` and `undefined`):\r\n- `injector.get(x, undefined)` is `any`\r\n- `injector.get(x, THROW_IF_NOT_NULL)` is `any`\r\n- `injector.get(x, y)` is `any`\r\n- `injector.get(x, someCondition ? y : THROW_IF_NOT_NULL)` is `any`\r\n\r\n## What is the new behavior?\r\n- `injector.get(x, undefined)` is `T`\r\n- `injector.get(x, THROW_IF_NOT_NULL)` is `T`\r\n- `injector.get(x, y)` is `T|U`.\r\n- `injector.get(x, someCondition ? y : THROW_IF_NOT_NULL)` is `T|U`\r\n\r\n## Does this PR introduce a breaking change?\r\n```\r\n[x] Yes\r\n[ ] No\r\n```\r\n\r\n<!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. -->\r\nApplications may need to be corrected for revealed type errors. Applications explicitly specifying the generic argument to the method should remove the generic argument in favor of type inference.\r\n\r\n\r\n## Other information\r\n","created_at":"2018-05-25T03:44:12Z","updated_at":"2018-05-25T03:44:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/angular/angular/pulls/24118/commits","review_comments_url":"https://api.github.com/repos/angular/angular/pulls/24118/comments","review_comment_url":"https://api.github.com/repos/angular/angular/pulls/comments{/number}","comments_url":"https://api.github.com/repos/angular/angular/issues/24118/comments","statuses_url":"https://api.github.com/repos/angular/angular/statuses/6c9e8c37bfacf2252c0dd272c0fda10aea07b66e","head":{"label":"ts2do:injector-get-fix","ref":"injector-get-fix","sha":"6c9e8c37bfacf2252c0dd272c0fda10aea07b66e","user":{"login":"ts2do","id":723753,"avatar_url":"https://avatars2.githubusercontent.com/u/723753?v=4","gravatar_id":"","url":"https://api.github.com/users/ts2do","html_url":"https://github.com/ts2do","followers_url":"https://api.github.com/users/ts2do/followers","following_url":"https://api.github.com/users/ts2do/following{/other_user}","gists_url":"https://api.github.com/users/ts2do/gists{/gist_id}","starred_url":"https://api.github.com/users/ts2do/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ts2do/subscriptions","organizations_url":"https://api.github.com/users/ts2do/orgs","repos_url":"https://api.github.com/users/ts2do/repos","events_url":"https://api.github.com/users/ts2do/events{/privacy}","received_events_url":"https://api.github.com/users/ts2do/received_events","type":"User","site_admin":false},"repo":{"id":134787701,"name":"angular","full_name":"ts2do/angular","owner":{"login":"ts2do","id":723753,"avatar_url":"https://avatars2.githubusercontent.com/u/723753?v=4","gravatar_id":"","url":"https://api.github.com/users/ts2do","html_url":"https://github.com/ts2do","followers_url":"https://api.github.com/users/ts2do/followers","following_url":"https://api.github.com/users/ts2do/following{/other_user}","gists_url":"https://api.github.com/users/ts2do/gists{/gist_id}","starred_url":"https://api.github.com/users/ts2do/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ts2do/subscriptions","organizations_url":"https://api.github.com/users/ts2do/orgs","repos_url":"https://api.github.com/users/ts2do/repos","events_url":"https://api.github.com/users/ts2do/events{/privacy}","received_events_url":"https://api.github.com/users/ts2do/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ts2do/angular","description":"One framework. Mobile & desktop.","fork":true,"url":"https://api.github.com/repos/ts2do/angular","forks_url":"https://api.github.com/repos/ts2do/angular/forks","keys_url":"https://api.github.com/repos/ts2do/angular/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ts2do/angular/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ts2do/angular/teams","hooks_url":"https://api.github.com/repos/ts2do/angular/hooks","issue_events_url":"https://api.github.com/repos/ts2do/angular/issues/events{/number}","events_url":"https://api.github.com/repos/ts2do/angular/events","assignees_url":"https://api.github.com/repos/ts2do/angular/assignees{/user}","branches_url":"https://api.github.com/repos/ts2do/angular/branches{/branch}","tags_url":"https://api.github.com/repos/ts2do/angular/tags","blobs_url":"https://api.github.com/repos/ts2do/angular/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ts2do/angular/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ts2do/angular/git/refs{/sha}","trees_url":"https://api.github.com/repos/ts2do/angular/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ts2do/angular/statuses/{sha}","languages_url":"https://api.github.com/repos/ts2do/angular/languages","stargazers_url":"https://api.github.com/repos/ts2do/angular/stargazers","contributors_url":"https://api.github.com/repos/ts2do/angular/contributors","subscribers_url":"https://api.github.com/repos/ts2do/angular/subscribers","subscription_url":"https://api.github.com/repos/ts2do/angular/subscription","commits_url":"https://api.github.com/repos/ts2do/angular/commits{/sha}","git_commits_url":"https://api.github.com/repos/ts2do/angular/git/commits{/sha}","comments_url":"https://api.github.com/repos/ts2do/angular/comments{/number}","issue_comment_url":"https://api.github.com/repos/ts2do/angular/issues/comments{/number}","contents_url":"https://api.github.com/repos/ts2do/angular/contents/{+path}","compare_url":"https://api.github.com/repos/ts2do/angular/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ts2do/angular/merges","archive_url":"https://api.github.com/repos/ts2do/angular/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ts2do/angular/downloads","issues_url":"https://api.github.com/repos/ts2do/angular/issues{/number}","pulls_url":"https://api.github.com/repos/ts2do/angular/pulls{/number}","milestones_url":"https://api.github.com/repos/ts2do/angular/milestones{/number}","notifications_url":"https://api.github.com/repos/ts2do/angular/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ts2do/angular/labels{/name}","releases_url":"https://api.github.com/repos/ts2do/angular/releases{/id}","deployments_url":"https://api.github.com/repos/ts2do/angular/deployments","created_at":"2018-05-25T01:35:36Z","updated_at":"2018-05-25T01:35:56Z","pushed_at":"2018-05-25T03:25:57Z","git_url":"git://github.com/ts2do/angular.git","ssh_url":"git@github.com:ts2do/angular.git","clone_url":"https://github.com/ts2do/angular.git","svn_url":"https://github.com/ts2do/angular","homepage":"https://angular.io","size":79613,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","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":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"angular:master","ref":"master","sha":"13cb75da8b02ed7aa60508dbb5ecd9065809fd12","user":{"login":"angular","id":139426,"avatar_url":"https://avatars3.githubusercontent.com/u/139426?v=4","gravatar_id":"","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"repo":{"id":24195339,"name":"angular","full_name":"angular/angular","owner":{"login":"angular","id":139426,"avatar_url":"https://avatars3.githubusercontent.com/u/139426?v=4","gravatar_id":"","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/angular/angular","description":"One framework. Mobile & desktop.","fork":false,"url":"https://api.github.com/repos/angular/angular","forks_url":"https://api.github.com/repos/angular/angular/forks","keys_url":"https://api.github.com/repos/angular/angular/keys{/key_id}","collaborators_url":"https://api.github.com/repos/angular/angular/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/angular/angular/teams","hooks_url":"https://api.github.com/repos/angular/angular/hooks","issue_events_url":"https://api.github.com/repos/angular/angular/issues/events{/number}","events_url":"https://api.github.com/repos/angular/angular/events","assignees_url":"https://api.github.com/repos/angular/angular/assignees{/user}","branches_url":"https://api.github.com/repos/angular/angular/branches{/branch}","tags_url":"https://api.github.com/repos/angular/angular/tags","blobs_url":"https://api.github.com/repos/angular/angular/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/angular/angular/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/angular/angular/git/refs{/sha}","trees_url":"https://api.github.com/repos/angular/angular/git/trees{/sha}","statuses_url":"https://api.github.com/repos/angular/angular/statuses/{sha}","languages_url":"https://api.github.com/repos/angular/angular/languages","stargazers_url":"https://api.github.com/repos/angular/angular/stargazers","contributors_url":"https://api.github.com/repos/angular/angular/contributors","subscribers_url":"https://api.github.com/repos/angular/angular/subscribers","subscription_url":"https://api.github.com/repos/angular/angular/subscription","commits_url":"https://api.github.com/repos/angular/angular/commits{/sha}","git_commits_url":"https://api.github.com/repos/angular/angular/git/commits{/sha}","comments_url":"https://api.github.com/repos/angular/angular/comments{/number}","issue_comment_url":"https://api.github.com/repos/angular/angular/issues/comments{/number}","contents_url":"https://api.github.com/repos/angular/angular/contents/{+path}","compare_url":"https://api.github.com/repos/angular/angular/compare/{base}...{head}","merges_url":"https://api.github.com/repos/angular/angular/merges","archive_url":"https://api.github.com/repos/angular/angular/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/angular/angular/downloads","issues_url":"https://api.github.com/repos/angular/angular/issues{/number}","pulls_url":"https://api.github.com/repos/angular/angular/pulls{/number}","milestones_url":"https://api.github.com/repos/angular/angular/milestones{/number}","notifications_url":"https://api.github.com/repos/angular/angular/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/angular/angular/labels{/name}","releases_url":"https://api.github.com/repos/angular/angular/releases{/id}","deployments_url":"https://api.github.com/repos/angular/angular/deployments","created_at":"2014-09-18T16:12:01Z","updated_at":"2018-05-25T01:54:39Z","pushed_at":"2018-05-24T23:44:07Z","git_url":"git://github.com/angular/angular.git","ssh_url":"git@github.com:angular/angular.git","clone_url":"https://github.com/angular/angular.git","svn_url":"https://github.com/angular/angular","homepage":"https://angular.io","size":79613,"stargazers_count":36549,"watchers_count":36549,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":8858,"mirror_url":null,"archived":false,"open_issues_count":2398,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":8858,"open_issues":2398,"watchers":36549,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/angular/angular/pulls/24118"},"html":{"href":"https://github.com/angular/angular/pull/24118"},"issue":{"href":"https://api.github.com/repos/angular/angular/issues/24118"},"comments":{"href":"https://api.github.com/repos/angular/angular/issues/24118/comments"},"review_comments":{"href":"https://api.github.com/repos/angular/angular/pulls/24118/comments"},"review_comment":{"href":"https://api.github.com/repos/angular/angular/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/angular/angular/pulls/24118/commits"},"statuses":{"href":"https://api.github.com/repos/angular/angular/statuses/6c9e8c37bfacf2252c0dd272c0fda10aea07b66e"}},"author_association":"NONE","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":1,"additions":32,"deletions":7,"changed_files":5}}
{"actor":{"display_login":"ts2do"}}