{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/5911","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/5911/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/5911/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/5911/events","html_url":"https://github.com/Microsoft/TypeScript/issues/5911","id":120192361,"number":5911,"title":"async / await and PromiseLike","user":{"login":"dbaeumer","id":1931590,"avatar_url":"https://avatars.githubusercontent.com/u/1931590?v=3","gravatar_id":"","url":"https://api.github.com/users/dbaeumer","html_url":"https://github.com/dbaeumer","followers_url":"https://api.github.com/users/dbaeumer/followers","following_url":"https://api.github.com/users/dbaeumer/following{/other_user}","gists_url":"https://api.github.com/users/dbaeumer/gists{/gist_id}","starred_url":"https://api.github.com/users/dbaeumer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbaeumer/subscriptions","organizations_url":"https://api.github.com/users/dbaeumer/orgs","repos_url":"https://api.github.com/users/dbaeumer/repos","events_url":"https://api.github.com/users/dbaeumer/events{/privacy}","received_events_url":"https://api.github.com/users/dbaeumer/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Bug","name":"Bug","color":"e11d21"}],"state":"open","locked":false,"assignee":{"login":"rbuckton","id":3902892,"avatar_url":"https://avatars.githubusercontent.com/u/3902892?v=3","gravatar_id":"","url":"https://api.github.com/users/rbuckton","html_url":"https://github.com/rbuckton","followers_url":"https://api.github.com/users/rbuckton/followers","following_url":"https://api.github.com/users/rbuckton/following{/other_user}","gists_url":"https://api.github.com/users/rbuckton/gists{/gist_id}","starred_url":"https://api.github.com/users/rbuckton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rbuckton/subscriptions","organizations_url":"https://api.github.com/users/rbuckton/orgs","repos_url":"https://api.github.com/users/rbuckton/repos","events_url":"https://api.github.com/users/rbuckton/events{/privacy}","received_events_url":"https://api.github.com/users/rbuckton/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/Microsoft/TypeScript/milestones/15","html_url":"https://github.com/Microsoft/TypeScript/milestones/TypeScript%201.8","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/milestones/15/labels","id":1347987,"number":15,"title":"TypeScript 1.8","description":"","creator":{"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},"open_issues":134,"closed_issues":142,"state":"open","created_at":"2015-10-09T22:07:47Z","updated_at":"2015-12-07T23:14:45Z","due_on":null,"closed_at":null},"comments":40,"created_at":"2015-12-03T15:09:25Z","updated_at":"2015-12-08T02:28:51Z","closed_at":null,"body":"```typescript\r\nasync function delay(millis: number): PromiseLike<void> {\r\n\treturn Promise.resolve(undefined);\r\n}\r\n```\r\n\r\nThe code above is not valid and is rejected by the compiler. \r\n\r\nCould you explain why a PromiseLike is not sufficient as a return value. I looked at the generated code and I couldn't spot an obvious reason."},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/162739204","html_url":"https://github.com/Microsoft/TypeScript/issues/5911#issuecomment-162739204","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/5911","id":162739204,"user":{"login":"yortus","id":1252361,"avatar_url":"https://avatars.githubusercontent.com/u/1252361?v=3","gravatar_id":"","url":"https://api.github.com/users/yortus","html_url":"https://github.com/yortus","followers_url":"https://api.github.com/users/yortus/followers","following_url":"https://api.github.com/users/yortus/following{/other_user}","gists_url":"https://api.github.com/users/yortus/gists{/gist_id}","starred_url":"https://api.github.com/users/yortus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yortus/subscriptions","organizations_url":"https://api.github.com/users/yortus/orgs","repos_url":"https://api.github.com/users/yortus/repos","events_url":"https://api.github.com/users/yortus/events{/privacy}","received_events_url":"https://api.github.com/users/yortus/received_events","type":"User","site_admin":false},"created_at":"2015-12-08T02:28:51Z","updated_at":"2015-12-08T02:28:51Z","body":"```typescript\r\ninterface SomeIterator {\r\n\tnext: Function;\r\n}\r\n\r\ninterface SomePromise {\r\n\tthen: Function;\r\n}\r\n\r\nfunction* gf(): SomeIterator { } // OK\r\n\r\nasync function af(): SomePromise { } // ERROR\r\n\r\n```\r\n\r\nHow is this consistent?\r\n"}}