{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/10699","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/10699/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/10699/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/10699/events","html_url":"https://github.com/Microsoft/TypeScript/issues/10699","id":174938028,"number":10699,"title":"Fix PromiseConstructor interface","user":{"login":"falsandtru","id":3143368,"avatar_url":"https://avatars.githubusercontent.com/u/3143368?v=3","gravatar_id":"","url":"https://api.github.com/users/falsandtru","html_url":"https://github.com/falsandtru","followers_url":"https://api.github.com/users/falsandtru/followers","following_url":"https://api.github.com/users/falsandtru/following{/other_user}","gists_url":"https://api.github.com/users/falsandtru/gists{/gist_id}","starred_url":"https://api.github.com/users/falsandtru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/falsandtru/subscriptions","organizations_url":"https://api.github.com/users/falsandtru/orgs","repos_url":"https://api.github.com/users/falsandtru/repos","events_url":"https://api.github.com/users/falsandtru/events{/privacy}","received_events_url":"https://api.github.com/users/falsandtru/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Accepting%20PRs","name":"Accepting PRs","color":"009800"},{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Bug","name":"Bug","color":"e11d21"},{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Domain:%20lib.d.ts","name":"Domain: lib.d.ts","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/Microsoft/TypeScript/milestones/2","html_url":"https://github.com/Microsoft/TypeScript/milestones/Community","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/milestones/2/labels","id":721044,"number":2,"title":"Community","description":"Issues in the 'Community' milestone are ones which we are accepting pull requests for","creator":{"login":"RyanCavanaugh","id":6685088,"avatar_url":"https://avatars.githubusercontent.com/u/6685088?v=3","gravatar_id":"","url":"https://api.github.com/users/RyanCavanaugh","html_url":"https://github.com/RyanCavanaugh","followers_url":"https://api.github.com/users/RyanCavanaugh/followers","following_url":"https://api.github.com/users/RyanCavanaugh/following{/other_user}","gists_url":"https://api.github.com/users/RyanCavanaugh/gists{/gist_id}","starred_url":"https://api.github.com/users/RyanCavanaugh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RyanCavanaugh/subscriptions","organizations_url":"https://api.github.com/users/RyanCavanaugh/orgs","repos_url":"https://api.github.com/users/RyanCavanaugh/repos","events_url":"https://api.github.com/users/RyanCavanaugh/events{/privacy}","received_events_url":"https://api.github.com/users/RyanCavanaugh/received_events","type":"User","site_admin":false},"open_issues":206,"closed_issues":95,"state":"open","created_at":"2014-07-14T23:24:58Z","updated_at":"2016-09-06T19:59:44Z","due_on":null,"closed_at":null},"comments":9,"created_at":"2016-09-04T08:34:43Z","updated_at":"2016-09-06T23:43:24Z","closed_at":null,"body":"**TypeScript Version:**  master\r\n\r\n```diff\r\ninterface PromiseConstructor {\r\n-    reject(reason: any): Promise<never>;\r\n-    reject<T>(reason: any): Promise<T>;\r\n+    reject(reason?: any): Promise<never>;\r\n}\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/245130507","html_url":"https://github.com/Microsoft/TypeScript/issues/10699#issuecomment-245130507","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/10699","id":245130507,"user":{"login":"mhegazy","id":8000722,"avatar_url":"https://avatars.githubusercontent.com/u/8000722?v=3","gravatar_id":"","url":"https://api.github.com/users/mhegazy","html_url":"https://github.com/mhegazy","followers_url":"https://api.github.com/users/mhegazy/followers","following_url":"https://api.github.com/users/mhegazy/following{/other_user}","gists_url":"https://api.github.com/users/mhegazy/gists{/gist_id}","starred_url":"https://api.github.com/users/mhegazy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhegazy/subscriptions","organizations_url":"https://api.github.com/users/mhegazy/orgs","repos_url":"https://api.github.com/users/mhegazy/repos","events_url":"https://api.github.com/users/mhegazy/events{/privacy}","received_events_url":"https://api.github.com/users/mhegazy/received_events","type":"User","site_admin":false},"created_at":"2016-09-06T23:43:24Z","updated_at":"2016-09-06T23:43:24Z","body":"sorry, meant `Promise<string>`. so:\r\n\r\n```ts\r\nfunction f() {\r\n    return Promise.resolve()\r\n        .then(() => Promise.resolve(), () => <Promise<string>>Promise.reject(''));\r\n}\r\n```\r\n\r\nis basically the same as:\r\n\r\n```ts\r\n// An expected return type is Promise<void>, actually it returns Promise<string | void>\r\nfunction f() {\r\n  return Promise.resolve()\r\n    .then(() => Promise.resolve(), () => Promise.reject<string>(''));\r\n}\r\n```\r\n\r\nexcept that the later is easier to write and nicer to read."}}
{"actor":{"display_login":"mhegazy"}}