{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/26447","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/26447/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/26447/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/26447/events","html_url":"https://github.com/Microsoft/TypeScript/issues/26447","id":350536310,"node_id":"MDU6SXNzdWUzNTA1MzYzMTA=","number":26447,"title":"Wrong error message for `this` in function","user":{"login":"andy-ms","id":19274678,"node_id":"MDQ6VXNlcjE5Mjc0Njc4","avatar_url":"https://avatars3.githubusercontent.com/u/19274678?v=4","gravatar_id":"","url":"https://api.github.com/users/andy-ms","html_url":"https://github.com/andy-ms","followers_url":"https://api.github.com/users/andy-ms/followers","following_url":"https://api.github.com/users/andy-ms/following{/other_user}","gists_url":"https://api.github.com/users/andy-ms/gists{/gist_id}","starred_url":"https://api.github.com/users/andy-ms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andy-ms/subscriptions","organizations_url":"https://api.github.com/users/andy-ms/orgs","repos_url":"https://api.github.com/users/andy-ms/repos","events_url":"https://api.github.com/users/andy-ms/events{/privacy}","received_events_url":"https://api.github.com/users/andy-ms/received_events","type":"User","site_admin":false},"labels":[{"id":113970366,"node_id":"MDU6TGFiZWwxMTM5NzAzNjY=","url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Bug","name":"Bug","color":"e11d21","default":false},{"id":306530502,"node_id":"MDU6TGFiZWwzMDY1MzA1MDI=","url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Domain:%20Error%20Messages","name":"Domain: Error Messages","color":"fef2c0","default":false}],"state":"open","locked":false,"assignee":{"login":"DanielRosenwasser","id":972891,"node_id":"MDQ6VXNlcjk3Mjg5MQ==","avatar_url":"https://avatars2.githubusercontent.com/u/972891?v=4","gravatar_id":"","url":"https://api.github.com/users/DanielRosenwasser","html_url":"https://github.com/DanielRosenwasser","followers_url":"https://api.github.com/users/DanielRosenwasser/followers","following_url":"https://api.github.com/users/DanielRosenwasser/following{/other_user}","gists_url":"https://api.github.com/users/DanielRosenwasser/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielRosenwasser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielRosenwasser/subscriptions","organizations_url":"https://api.github.com/users/DanielRosenwasser/orgs","repos_url":"https://api.github.com/users/DanielRosenwasser/repos","events_url":"https://api.github.com/users/DanielRosenwasser/events{/privacy}","received_events_url":"https://api.github.com/users/DanielRosenwasser/received_events","type":"User","site_admin":false},"assignees":[{"login":"DanielRosenwasser","id":972891,"node_id":"MDQ6VXNlcjk3Mjg5MQ==","avatar_url":"https://avatars2.githubusercontent.com/u/972891?v=4","gravatar_id":"","url":"https://api.github.com/users/DanielRosenwasser","html_url":"https://github.com/DanielRosenwasser","followers_url":"https://api.github.com/users/DanielRosenwasser/followers","following_url":"https://api.github.com/users/DanielRosenwasser/following{/other_user}","gists_url":"https://api.github.com/users/DanielRosenwasser/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielRosenwasser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielRosenwasser/subscriptions","organizations_url":"https://api.github.com/users/DanielRosenwasser/orgs","repos_url":"https://api.github.com/users/DanielRosenwasser/repos","events_url":"https://api.github.com/users/DanielRosenwasser/events{/privacy}","received_events_url":"https://api.github.com/users/DanielRosenwasser/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2018-08-14T18:04:04Z","updated_at":"2018-08-14T18:06:09Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"**TypeScript Version:**  3.1.0-dev.20180810\r\n\r\n**Code**\r\n\r\n```ts\r\nfunction f() {\r\n    this.x;\r\n}\r\n```\r\n\r\n**Expected behavior:**\r\n\r\nError that `this` is implicitly `any`.\r\n\r\n**Actual behavior:**\r\n\r\n```\r\nsrc/a.ts:2:5 - error TS7041: The containing arrow function captures the global value of 'this' which implicitly has type 'any'.\r\n```\r\n\r\n...what arrow function?"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/412963907","html_url":"https://github.com/Microsoft/TypeScript/issues/26447#issuecomment-412963907","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/26447","id":412963907,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMjk2MzkwNw==","user":{"login":"andy-ms","id":19274678,"node_id":"MDQ6VXNlcjE5Mjc0Njc4","avatar_url":"https://avatars3.githubusercontent.com/u/19274678?v=4","gravatar_id":"","url":"https://api.github.com/users/andy-ms","html_url":"https://github.com/andy-ms","followers_url":"https://api.github.com/users/andy-ms/followers","following_url":"https://api.github.com/users/andy-ms/following{/other_user}","gists_url":"https://api.github.com/users/andy-ms/gists{/gist_id}","starred_url":"https://api.github.com/users/andy-ms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andy-ms/subscriptions","organizations_url":"https://api.github.com/users/andy-ms/orgs","repos_url":"https://api.github.com/users/andy-ms/repos","events_url":"https://api.github.com/users/andy-ms/events{/privacy}","received_events_url":"https://api.github.com/users/andy-ms/received_events","type":"User","site_admin":false},"created_at":"2018-08-14T18:06:09Z","updated_at":"2018-08-14T18:06:09Z","author_association":"CONTRIBUTOR","body":"On that note, we should also have a good error message in the following situation:\r\n```ts\r\nclass C {\r\n    m() {\r\n        this.m();\r\n        function f() {\r\n            this.m();\r\n        }\r\n    }\r\n}\r\n```\r\nThis is a common error and it's not obvious why `this` works in one place but not the other. The error message should indicate the place where `this` was shadowed."}}
{"actor":{"display_login":"andy-ms"}}