{"action":"closed","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/21823","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/21823/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/21823/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/21823/events","html_url":"https://github.com/Microsoft/TypeScript/issues/21823","id":295770133,"number":21823,"title":"identical conditional types with a callable constituent not assignable to each other","user":{"login":"tvald","id":406656,"avatar_url":"https://avatars3.githubusercontent.com/u/406656?v=4","gravatar_id":"","url":"https://api.github.com/users/tvald","html_url":"https://github.com/tvald","followers_url":"https://api.github.com/users/tvald/followers","following_url":"https://api.github.com/users/tvald/following{/other_user}","gists_url":"https://api.github.com/users/tvald/gists{/gist_id}","starred_url":"https://api.github.com/users/tvald/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tvald/subscriptions","organizations_url":"https://api.github.com/users/tvald/orgs","repos_url":"https://api.github.com/users/tvald/repos","events_url":"https://api.github.com/users/tvald/events{/privacy}","received_events_url":"https://api.github.com/users/tvald/received_events","type":"User","site_admin":false},"labels":[{"id":113970366,"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Bug","name":"Bug","color":"e11d21","default":false},{"id":114001888,"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Fixed","name":"Fixed","color":"bfe5bf","default":false}],"state":"closed","locked":false,"assignee":{"login":"ahejlsberg","id":4226954,"avatar_url":"https://avatars1.githubusercontent.com/u/4226954?v=4","gravatar_id":"","url":"https://api.github.com/users/ahejlsberg","html_url":"https://github.com/ahejlsberg","followers_url":"https://api.github.com/users/ahejlsberg/followers","following_url":"https://api.github.com/users/ahejlsberg/following{/other_user}","gists_url":"https://api.github.com/users/ahejlsberg/gists{/gist_id}","starred_url":"https://api.github.com/users/ahejlsberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahejlsberg/subscriptions","organizations_url":"https://api.github.com/users/ahejlsberg/orgs","repos_url":"https://api.github.com/users/ahejlsberg/repos","events_url":"https://api.github.com/users/ahejlsberg/events{/privacy}","received_events_url":"https://api.github.com/users/ahejlsberg/received_events","type":"User","site_admin":false},"assignees":[{"login":"ahejlsberg","id":4226954,"avatar_url":"https://avatars1.githubusercontent.com/u/4226954?v=4","gravatar_id":"","url":"https://api.github.com/users/ahejlsberg","html_url":"https://github.com/ahejlsberg","followers_url":"https://api.github.com/users/ahejlsberg/followers","following_url":"https://api.github.com/users/ahejlsberg/following{/other_user}","gists_url":"https://api.github.com/users/ahejlsberg/gists{/gist_id}","starred_url":"https://api.github.com/users/ahejlsberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahejlsberg/subscriptions","organizations_url":"https://api.github.com/users/ahejlsberg/orgs","repos_url":"https://api.github.com/users/ahejlsberg/repos","events_url":"https://api.github.com/users/ahejlsberg/events{/privacy}","received_events_url":"https://api.github.com/users/ahejlsberg/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/Microsoft/TypeScript/milestones/61","html_url":"https://github.com/Microsoft/TypeScript/milestone/61","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/milestones/61/labels","id":2941810,"number":61,"title":"TypeScript 2.8","description":null,"creator":{"login":"mhegazy","id":8000722,"avatar_url":"https://avatars3.githubusercontent.com/u/8000722?v=4","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":249,"closed_issues":67,"state":"open","created_at":"2017-11-28T01:28:09Z","updated_at":"2018-02-11T01:14:41Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2018-02-09T06:42:33Z","updated_at":"2018-02-11T01:14:41Z","closed_at":"2018-02-11T01:14:41Z","author_association":"NONE","body":"This is a slightly more complicated version of #21756, and is still present after #21782. When a conditional type has a callable constituent, the types are not assignable to each other.\r\n\r\n**TypeScript Version:**  2.8.0-dev.20180208 (latest master)\r\n\r\n**Code**\r\n\r\n```ts\r\ntype F1<T> = T extends 0 ? 0 : () => 0;\r\ntype F2<T> = T extends 0 ? 0 : () => 0;\r\nconst f = <T>(a: F1<T>): F2<T> => a; // fails\r\n\r\ntype G1<T> = T extends 0 ? 0 : string;\r\ntype G2<T> = T extends 0 ? 0 : string;\r\nconst g = <T>(a: G1<T>): G2<T> => a; // passes\r\n\r\n```\r\n\r\n**Expected behavior:**\r\nno errors\r\n\r\n**Actual behavior:**\r\n```\r\nTypeScript $ node lib/tsc --noEmit test.ts\r\ntest.ts(11,35): error TS2322: Type 'F1<T>' is not assignable to type 'F2<T>'.\r\n  Type '0 | (() => 0)' is not assignable to type 'F2<T>'.\r\n    Type '0' is not assignable to type 'F2<T>'.\r\n```\r\n"}}
{"actor":{"display_login":"ahejlsberg"}}