{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/13164","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/13164/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/13164/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/13164/events","html_url":"https://github.com/Microsoft/TypeScript/issues/13164","id":197504149,"number":13164,"title":"Salsa template intellisense not determined type by type of function callback","user":{"login":"Thaina","id":1042507,"avatar_url":"https://avatars.githubusercontent.com/u/1042507?v=3","gravatar_id":"","url":"https://api.github.com/users/Thaina","html_url":"https://github.com/Thaina","followers_url":"https://api.github.com/users/Thaina/followers","following_url":"https://api.github.com/users/Thaina/following{/other_user}","gists_url":"https://api.github.com/users/Thaina/gists{/gist_id}","starred_url":"https://api.github.com/users/Thaina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Thaina/subscriptions","organizations_url":"https://api.github.com/users/Thaina/orgs","repos_url":"https://api.github.com/users/Thaina/repos","events_url":"https://api.github.com/users/Thaina/events{/privacy}","received_events_url":"https://api.github.com/users/Thaina/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-12-25T14:55:47Z","updated_at":"2016-12-25T15:08:20Z","closed_at":null,"body":"I made a function like this\r\n\r\n```js\r\n/** @template T,U\r\n *  @param {T[]} arrays\r\n *  @param {function(T,number):Promise<U>} func\r\n *  @returns {Promise<U[]>} */\r\nfunction AsyncEach(arrays,func) {\r\n\tvar results = [];\r\n\treturn arrays.reduce((promise,item,i) => {\r\n\t\treturn promise.then(() => func(item,i)).then((res) => {\r\n\t\t\tresults.push(res);\r\n\t\t});\r\n\t},Promise.resolve()).then(() => results);\r\n}\r\n```\r\n\r\nthen use it like this\r\n\r\n```js\r\n\tvar zz\t= AsyncEach(league.results,(stat,i) => {\r\n\t\treturn Promise.resolve(i);\r\n\t});\r\n```\r\n\r\nand expect `zz` it to return type `Promise<number[]>`\r\n\r\nBut I got this instead\r\n\r\n![image](https://cloud.githubusercontent.com/assets/1042507/21471707/5c2d856e-caed-11e6-96b8-d5f005611156.png)\r\n\r\n\r\nUsing typescript 2.1.0-dev.20161031"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/269126334","html_url":"https://github.com/Microsoft/TypeScript/issues/13164#issuecomment-269126334","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/13164","id":269126334,"user":{"login":"aluanhaddad","id":5034656,"avatar_url":"https://avatars.githubusercontent.com/u/5034656?v=3","gravatar_id":"","url":"https://api.github.com/users/aluanhaddad","html_url":"https://github.com/aluanhaddad","followers_url":"https://api.github.com/users/aluanhaddad/followers","following_url":"https://api.github.com/users/aluanhaddad/following{/other_user}","gists_url":"https://api.github.com/users/aluanhaddad/gists{/gist_id}","starred_url":"https://api.github.com/users/aluanhaddad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aluanhaddad/subscriptions","organizations_url":"https://api.github.com/users/aluanhaddad/orgs","repos_url":"https://api.github.com/users/aluanhaddad/repos","events_url":"https://api.github.com/users/aluanhaddad/events{/privacy}","received_events_url":"https://api.github.com/users/aluanhaddad/received_events","type":"User","site_admin":false},"created_at":"2016-12-25T15:08:20Z","updated_at":"2016-12-25T15:08:20Z","body":"The latest release is 2.1.4 which is more recent than the version you are using but still demonstrates the issue."}}
{"actor":{"display_login":"aluanhaddad"}}