{"action":"opened","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/7703","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/7703/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/7703/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/7703/events","html_url":"https://github.com/Microsoft/TypeScript/issues/7703","id":143778849,"number":7703,"title":"VS/VS Code: Return type mismatch of an arrow function passed as an argument highlights the whole function body in red","user":{"login":"malibuzios","id":17719551,"avatar_url":"https://avatars.githubusercontent.com/u/17719551?v=3","gravatar_id":"","url":"https://api.github.com/users/malibuzios","html_url":"https://github.com/malibuzios","followers_url":"https://api.github.com/users/malibuzios/followers","following_url":"https://api.github.com/users/malibuzios/following{/other_user}","gists_url":"https://api.github.com/users/malibuzios/gists{/gist_id}","starred_url":"https://api.github.com/users/malibuzios/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/malibuzios/subscriptions","organizations_url":"https://api.github.com/users/malibuzios/orgs","repos_url":"https://api.github.com/users/malibuzios/repos","events_url":"https://api.github.com/users/malibuzios/events{/privacy}","received_events_url":"https://api.github.com/users/malibuzios/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-27T05:43:46Z","updated_at":"2016-03-27T05:43:46Z","closed_at":null,"body":"Hopefully this is not a duplicate (couldn't find anything). Out of all the \"less desirable\" VS (and VS code as well) plugin behaviors I've found this to be the number one most disturbing one.\r\n\r\n**TypeScript Version:** \r\n\r\n1.8.7 (VS 2015 Community, Update 1)\r\n\r\n**Screenshots**\r\n![clipboard02](https://cloud.githubusercontent.com/assets/17719551/14063910/caa4cd04-f3f2-11e5-815f-7ae3aa215955.png)\r\n\r\n\r\nAnd after fixing the return type (only changed `PromiseX.start<void>` to `PromiseX.start<any>`):\r\n![clipboard03](https://cloud.githubusercontent.com/assets/17719551/14063911/d13828e6-f3f2-11e5-9313-ffedf5750fc5.png)\r\n\r\n**Reduced test case**\r\n\r\n```ts\r\nfunction func(f: () => number) {\r\n}\r\n\r\nfunc(() => {\r\n\tlet x = \"HI\"; // <-- Highlighted in red\r\n\treturn x;     // <-- Highlighted in red\r\n});\r\n```\r\nFor comparison, when `function` is used instead, only the keyword \"function\" is highlighted:\r\n```ts\r\nfunction func(f: () => number) {\r\n}\r\n\r\nfunc(function() { // <-- only the \"function\" keyword is highlighted in red\r\n\tlet x = \"HI\"; \r\n\treturn x;\r\n});\r\n```\r\n**Suggestion**\r\n\r\nNo need to highlight the whole function body in this case. Highlighting only the arrow (i.e. `=>`) could also work (I tried to find a solution that would work with all variations of the arrow notation, e.g. including reduced notation like `val => val * 2`), would be significantly less distracting and wouldn't mask other errors within that same scope.\r\n\r\nOn a more personal note, I would be super-thankful if this would be fixed! It happens constantly when using callback or promise heavy code."}}