{"action":"opened","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/15708","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/15708/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/15708/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/15708/events","html_url":"https://github.com/Microsoft/TypeScript/issues/15708","id":227498346,"number":15708,"title":"Not inferring return type for Object.prototype extension","user":{"login":"dyst5422","id":13282627,"avatar_url":"https://avatars0.githubusercontent.com/u/13282627?v=3","gravatar_id":"","url":"https://api.github.com/users/dyst5422","html_url":"https://github.com/dyst5422","followers_url":"https://api.github.com/users/dyst5422/followers","following_url":"https://api.github.com/users/dyst5422/following{/other_user}","gists_url":"https://api.github.com/users/dyst5422/gists{/gist_id}","starred_url":"https://api.github.com/users/dyst5422/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dyst5422/subscriptions","organizations_url":"https://api.github.com/users/dyst5422/orgs","repos_url":"https://api.github.com/users/dyst5422/repos","events_url":"https://api.github.com/users/dyst5422/events{/privacy}","received_events_url":"https://api.github.com/users/dyst5422/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-05-09T21:07:34Z","updated_at":"2017-05-09T21:07:34Z","closed_at":null,"body":"<!-- BUGS: Please use this template. -->\r\n<!-- QUESTIONS: This is not a general support forum! Ask Qs at http://stackoverflow.com/questions/tagged/typescript -->\r\n<!-- SUGGESTIONS: See https://github.com/Microsoft/TypeScript-wiki/blob/master/Writing-Good-Design-Proposals.md -->\r\n\r\n**TypeScript Version:**  2.3.2\r\n\r\n**Code**\r\n\r\ncode.ts\r\n```ts\r\nObject.prototype.get = function get() {\r\n  return this\r\n};\r\n\r\nconst a = { prop1: 2 };\r\n\r\nconsole.log(a.get().prop1);\r\n```\r\n\r\ntypes.d.ts\r\n```ts\r\ninterface Object {\r\n  get(): this;\r\n}\r\n```\r\n\r\n**Expected behavior:**\r\nI should be able to have correct type on the return of a.get() such that it should know that prop1 exists\r\n**Actual behavior:**\r\non compile\r\nTSError: Property 'prop1' does not exist on type 'Object'\r\n\r\n"}}
{"actor":{"display_login":"dyst5422"}}