{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/23929","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/23929/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/23929/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/23929/events","html_url":"https://github.com/Microsoft/TypeScript/issues/23929","id":320751015,"number":23929,"title":"Parameters not being enforced properly","user":{"login":"jpike88","id":9585787,"avatar_url":"https://avatars1.githubusercontent.com/u/9585787?v=4","gravatar_id":"","url":"https://api.github.com/users/jpike88","html_url":"https://github.com/jpike88","followers_url":"https://api.github.com/users/jpike88/followers","following_url":"https://api.github.com/users/jpike88/following{/other_user}","gists_url":"https://api.github.com/users/jpike88/gists{/gist_id}","starred_url":"https://api.github.com/users/jpike88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpike88/subscriptions","organizations_url":"https://api.github.com/users/jpike88/orgs","repos_url":"https://api.github.com/users/jpike88/repos","events_url":"https://api.github.com/users/jpike88/events{/privacy}","received_events_url":"https://api.github.com/users/jpike88/received_events","type":"User","site_admin":false},"labels":[{"id":113971558,"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Question","name":"Question","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-05-07T10:18:44Z","updated_at":"2018-05-07T16:45:50Z","closed_at":null,"author_association":"NONE","body":"<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨\r\n\r\nHalf of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Even if you think you've found a *bug*, please read the FAQ first, especially the Common \"Bugs\" That Aren't Bugs section!\r\n\r\nPlease help us by doing the following steps before logging an issue:\r\n  * Search: https://github.com/Microsoft/TypeScript/search?type=Issues\r\n  * Read the FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ\r\n\r\nPlease fill in the *entire* template below.\r\n-->\r\n\r\n<!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->\r\n**TypeScript Version:**  2.8.1\r\n\r\n<!-- Search terms you tried before logging this (so others can find this issue more easily) -->\r\n**Search Terms:** this rest parameters\r\n\r\n**Code**\r\n\r\n```ts\r\n\r\ninterface ApiMethods {\r\n    [s: string]: ApiMethod;\r\n}\r\n\r\ntype ApiMethod = {\r\n    (this:ApiHandler, ...args: any[]): Promise<void>;\r\n}\r\n\r\nexport default <ApiMethods>{\r\n\tthisMethodShouldBeOK,\r\n        thisMethodShouldNotBeOK\r\n}\r\n\r\nasync function thisMethodShouldBeOK(this:ApiHandler, query:string) {\r\n}\r\n\r\nasync function thisMethodShouldNotBeOK(query:string) {\r\n}\r\n\r\n\r\n```\r\n\r\n**Expected behavior:**\r\n\r\nthisMethodShouldNotBeOK should be showing as an error, because it doesn't specify a type for this as the first parameter.\r\n\r\n**Actual behavior:**\r\n\r\nthisMethodShouldNotBeOK should be firing an error on compile, but it's not.\r\n\r\nthe 'this:ApiHander' parameter in the ApiMethod type is not being enforced properly.\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/387127185","html_url":"https://github.com/Microsoft/TypeScript/issues/23929#issuecomment-387127185","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/23929","id":387127185,"user":{"login":"jpike88","id":9585787,"avatar_url":"https://avatars1.githubusercontent.com/u/9585787?v=4","gravatar_id":"","url":"https://api.github.com/users/jpike88","html_url":"https://github.com/jpike88","followers_url":"https://api.github.com/users/jpike88/followers","following_url":"https://api.github.com/users/jpike88/following{/other_user}","gists_url":"https://api.github.com/users/jpike88/gists{/gist_id}","starred_url":"https://api.github.com/users/jpike88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpike88/subscriptions","organizations_url":"https://api.github.com/users/jpike88/orgs","repos_url":"https://api.github.com/users/jpike88/repos","events_url":"https://api.github.com/users/jpike88/events{/privacy}","received_events_url":"https://api.github.com/users/jpike88/received_events","type":"User","site_admin":false},"created_at":"2018-05-07T16:45:50Z","updated_at":"2018-05-07T16:45:50Z","author_association":"NONE","body":"correct, they all must have this:ApiHandler present because ```this.callback(isError:boolean, payload:any)``` is always present, and fires an API response."}}
{"actor":{"display_login":"jpike88"}}