{"action":"opened","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/8363","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/8363/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/8363/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/8363/events","html_url":"https://github.com/Microsoft/TypeScript/issues/8363","id":151759934,"number":8363,"title":"Allow `this` in static initializers","user":{"login":"bterlson","id":11236,"avatar_url":"https://avatars.githubusercontent.com/u/11236?v=3","gravatar_id":"","url":"https://api.github.com/users/bterlson","html_url":"https://github.com/bterlson","followers_url":"https://api.github.com/users/bterlson/followers","following_url":"https://api.github.com/users/bterlson/following{/other_user}","gists_url":"https://api.github.com/users/bterlson/gists{/gist_id}","starred_url":"https://api.github.com/users/bterlson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bterlson/subscriptions","organizations_url":"https://api.github.com/users/bterlson/orgs","repos_url":"https://api.github.com/users/bterlson/repos","events_url":"https://api.github.com/users/bterlson/events{/privacy}","received_events_url":"https://api.github.com/users/bterlson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-28T22:44:44Z","updated_at":"2016-04-28T22:44:44Z","closed_at":null,"body":"The following is an error:\r\n\r\n```ts\r\nfunction factory() {\r\n  return class {\r\n    static x = 1;\r\n    static y = this.x * 2;\r\n  }\r\n}\r\n```\r\n\r\nI can see some potential for confusion here, though I'm not sure what that confusion might be. On the flip side, it seems useful to be able to refer to an anonymous class in a static initializer. It is also easy to teach that \"this in instance initializers = the instance, this in static initializers = the class, same as methods vs. static methods.\""}}