{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/4045","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/4045/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/4045/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/4045/events","html_url":"https://github.com/Microsoft/TypeScript/issues/4045","id":97557014,"number":4045,"title":"`const` in class body","user":{"login":"nycdotnet","id":3755379,"avatar_url":"https://avatars.githubusercontent.com/u/3755379?v=3","gravatar_id":"","url":"https://api.github.com/users/nycdotnet","html_url":"https://github.com/nycdotnet","followers_url":"https://api.github.com/users/nycdotnet/followers","following_url":"https://api.github.com/users/nycdotnet/following{/other_user}","gists_url":"https://api.github.com/users/nycdotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/nycdotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nycdotnet/subscriptions","organizations_url":"https://api.github.com/users/nycdotnet/orgs","repos_url":"https://api.github.com/users/nycdotnet/repos","events_url":"https://api.github.com/users/nycdotnet/events{/privacy}","received_events_url":"https://api.github.com/users/nycdotnet/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Accepting%20PRs","name":"Accepting PRs","color":"009800"},{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Bug","name":"Bug","color":"e11d21"},{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Effort:%20Moderate","name":"Effort: Moderate","color":"207de5"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/Microsoft/TypeScript/milestones/2","html_url":"https://github.com/Microsoft/TypeScript/milestones/Community","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/milestones/2/labels","id":721044,"number":2,"title":"Community","description":"Issues in the 'Community' milestone are ones which we are accepting pull requests for","creator":{"login":"RyanCavanaugh","id":6685088,"avatar_url":"https://avatars.githubusercontent.com/u/6685088?v=3","gravatar_id":"","url":"https://api.github.com/users/RyanCavanaugh","html_url":"https://github.com/RyanCavanaugh","followers_url":"https://api.github.com/users/RyanCavanaugh/followers","following_url":"https://api.github.com/users/RyanCavanaugh/following{/other_user}","gists_url":"https://api.github.com/users/RyanCavanaugh/gists{/gist_id}","starred_url":"https://api.github.com/users/RyanCavanaugh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RyanCavanaugh/subscriptions","organizations_url":"https://api.github.com/users/RyanCavanaugh/orgs","repos_url":"https://api.github.com/users/RyanCavanaugh/repos","events_url":"https://api.github.com/users/RyanCavanaugh/events{/privacy}","received_events_url":"https://api.github.com/users/RyanCavanaugh/received_events","type":"User","site_admin":false},"open_issues":123,"closed_issues":43,"state":"open","created_at":"2014-07-14T23:24:58Z","updated_at":"2015-09-28T04:06:30Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2015-07-27T21:19:29Z","updated_at":"2015-09-28T07:24:17Z","closed_at":null,"body":"Hi,\r\n\r\nI know ES6 doesn't support using const with class members and I'm assuming this is why TypeScript also does not.  I'm wondering if the error if someone tries to do this with TypeScript can be improved.\r\n\r\n```ts\r\nclass AtomicNumbers {\r\n  static const H = 1;\r\n  static const He = 2;\r\n}\r\n```\r\n\r\nIn the code above, TypeScript gives the error \"`'=' expected.`\", twice.\r\n\r\nIt would be much better to get an error such as \"Class members cannot be declared with the const keyword.\".  Bonus points if it suggested something like, \"Consider creating a module of the same name and exporting a constant from there.\"\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/143659250","html_url":"https://github.com/Microsoft/TypeScript/issues/4045#issuecomment-143659250","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/4045","id":143659250,"user":{"login":"JsonFreeman","id":8052525,"avatar_url":"https://avatars.githubusercontent.com/u/8052525?v=3","gravatar_id":"","url":"https://api.github.com/users/JsonFreeman","html_url":"https://github.com/JsonFreeman","followers_url":"https://api.github.com/users/JsonFreeman/followers","following_url":"https://api.github.com/users/JsonFreeman/following{/other_user}","gists_url":"https://api.github.com/users/JsonFreeman/gists{/gist_id}","starred_url":"https://api.github.com/users/JsonFreeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JsonFreeman/subscriptions","organizations_url":"https://api.github.com/users/JsonFreeman/orgs","repos_url":"https://api.github.com/users/JsonFreeman/repos","events_url":"https://api.github.com/users/JsonFreeman/events{/privacy}","received_events_url":"https://api.github.com/users/JsonFreeman/received_events","type":"User","site_admin":false},"created_at":"2015-09-28T07:24:17Z","updated_at":"2015-09-28T07:24:17Z","body":"You could use \"A class member cannot have *the* '{0}' modifier\""}}