{"action":"opened","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/6552","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/6552/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/6552/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/6552/events","html_url":"https://github.com/Microsoft/TypeScript/issues/6552","id":127789392,"number":6552,"title":"Use @param tags in function assignment","user":{"login":"billti","id":993909,"avatar_url":"https://avatars.githubusercontent.com/u/993909?v=3","gravatar_id":"","url":"https://api.github.com/users/billti","html_url":"https://github.com/billti","followers_url":"https://api.github.com/users/billti/followers","following_url":"https://api.github.com/users/billti/following{/other_user}","gists_url":"https://api.github.com/users/billti/gists{/gist_id}","starred_url":"https://api.github.com/users/billti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/billti/subscriptions","organizations_url":"https://api.github.com/users/billti/orgs","repos_url":"https://api.github.com/users/billti/repos","events_url":"https://api.github.com/users/billti/events{/privacy}","received_events_url":"https://api.github.com/users/billti/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-20T21:36:44Z","updated_at":"2016-01-20T21:36:44Z","closed_at":null,"body":"Using the Salsa work with `@param` tags works fine for function declarations, but not for assignments of function expressions. This is particularly a problem in the CommonJS case. For example with the module below, `sub` correctly shows the params as of type `number`, whereas `add` shows them as type `any`.\r\n\r\n```javascript\r\n/**\r\n * @param {number} a The number to subtract from\r\n * @param {number} b The number to subtract\r\n */\r\nfunction sub(a, b) {\r\n    return a - b;\r\n}\r\n\r\nexports.sub = sub;\r\n\r\n/**\r\n * @param {number} a - First term\r\n * @param {number} b - Second term\r\n */\r\nexports.add = function(a, b) {\r\n    return a + b; \r\n}\r\n```\r\n\r\nThe JsDoc tags should apply to the resulting value of the expression."}}