{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/17961","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/17961/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/17961/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/17961/events","html_url":"https://github.com/Microsoft/TypeScript/pull/17961","id":251960966,"node_id":"MDExOlB1bGxSZXF1ZXN0MTM2OTgzMTE1","number":17961,"title":"type-level function application","user":{"login":"tycho01","id":3059397,"node_id":"MDQ6VXNlcjMwNTkzOTc=","avatar_url":"https://avatars3.githubusercontent.com/u/3059397?v=4","gravatar_id":"","url":"https://api.github.com/users/tycho01","html_url":"https://github.com/tycho01","followers_url":"https://api.github.com/users/tycho01/followers","following_url":"https://api.github.com/users/tycho01/following{/other_user}","gists_url":"https://api.github.com/users/tycho01/gists{/gist_id}","starred_url":"https://api.github.com/users/tycho01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tycho01/subscriptions","organizations_url":"https://api.github.com/users/tycho01/orgs","repos_url":"https://api.github.com/users/tycho01/repos","events_url":"https://api.github.com/users/tycho01/events{/privacy}","received_events_url":"https://api.github.com/users/tycho01/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":32,"created_at":"2017-08-22T13:40:49Z","updated_at":"2018-07-25T18:31:23Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/Microsoft/TypeScript/pulls/17961","html_url":"https://github.com/Microsoft/TypeScript/pull/17961","diff_url":"https://github.com/Microsoft/TypeScript/pull/17961.diff","patch_url":"https://github.com/Microsoft/TypeScript/pull/17961.patch"},"body":"See the tests for usage. Syntax mirrors JS function calls, though expression-level variables must be lifted to the type level with `typeof` as before.\r\n\r\nProgress toward fixing #6606 and [others](https://github.com/Microsoft/TypeScript/issues/6606#issuecomment-317664772):\r\n- [x] functions with generics\r\n- [x] both functions and arguments support any type node, whether `typeof` variables, generics, interfaces, function literals, what have you\r\n- [x] no additional keywords needed so just chain calls like `()()()` if desired\r\n- [x] type subtraction\r\n- [x] heterogeneous `map`\r\n- [ ] debug binary function composition (type level working)\r\n- [ ] debug `reduce`\r\n- [x] ~~make `chooseOverload` consider type parameter values, not just their constraints, see https://github.com/Microsoft/TypeScript/issues/12424#issuecomment-320511965 / #17471~~\r\n- [x] address `awaited` use-case from #17077\r\n\r\nI took to heart the [advice](https://github.com/Microsoft/TypeScript/issues/6606#issuecomment-178266654) not to make the implementation too crazy -- although I added a type call node to parse this type variant of the traditional call expression, in the checker I opted to just 'cheat' and get it to evaluate `Fn(A, B)` as expression `(null! as Fn)(null! as A, null! as B)`.\r\n\r\n@Igorbek may now laugh at me for mocking `null! as type` notation.\r\n\r\n~~Note: the ambiguous `Ref<A>()` is currently parsed such that the type argument list `<A>` belongs to the type reference, not to the function call. I've enabled `Ref<><A>()` as an alternative. Before, adding an empty type argument list `<>` to a non-generic type would error stating the type is not generic.~~ Edit: I've removed type argument lists on type calls as they don't seem very useful.\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/407852245","html_url":"https://github.com/Microsoft/TypeScript/pull/17961#issuecomment-407852245","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/17961","id":407852245,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNzg1MjI0NQ==","user":{"login":"typescript-bot","id":23042052,"node_id":"MDQ6VXNlcjIzMDQyMDUy","avatar_url":"https://avatars0.githubusercontent.com/u/23042052?v=4","gravatar_id":"","url":"https://api.github.com/users/typescript-bot","html_url":"https://github.com/typescript-bot","followers_url":"https://api.github.com/users/typescript-bot/followers","following_url":"https://api.github.com/users/typescript-bot/following{/other_user}","gists_url":"https://api.github.com/users/typescript-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/typescript-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/typescript-bot/subscriptions","organizations_url":"https://api.github.com/users/typescript-bot/orgs","repos_url":"https://api.github.com/users/typescript-bot/repos","events_url":"https://api.github.com/users/typescript-bot/events{/privacy}","received_events_url":"https://api.github.com/users/typescript-bot/received_events","type":"User","site_admin":false},"created_at":"2018-07-25T18:31:23Z","updated_at":"2018-07-25T18:31:23Z","author_association":"COLLABORATOR","body":"Thanks for your contribution. This PR has not been updated in a while and cannot be automatically merged at the time being. For housekeeping purposes we are closing stale PRs. If you'd still like to continue working on this PR, please leave a message and one of the maintainers can reopen it."}}
{"actor":{"display_login":"typescript-bot"}}