{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/pulls/comments/30470859","id":30470859,"diff_hunk":"@@ -145,7 +145,7 @@ var E8;\n var E9;\r\n (function (E9) {\r\n     E9[E9[\"A\"] = 0] = \"A\";\r\n-    E9[E9[\"B\"] = 0] = \"B\";\r\n+    E9[\"B\"] = E9.A;\r","path":"tests/baselines/reference/enumBasics.js","position":5,"original_position":5,"commit_id":"04a10f553023f12b45bee1746f4c478e37278eba","original_commit_id":"04a10f553023f12b45bee1746f4c478e37278eba","user":{"login":"jbondc","id":199519,"avatar_url":"https://avatars.githubusercontent.com/u/199519?v=3","gravatar_id":"","url":"https://api.github.com/users/jbondc","html_url":"https://github.com/jbondc","followers_url":"https://api.github.com/users/jbondc/followers","following_url":"https://api.github.com/users/jbondc/following{/other_user}","gists_url":"https://api.github.com/users/jbondc/gists{/gist_id}","starred_url":"https://api.github.com/users/jbondc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbondc/subscriptions","organizations_url":"https://api.github.com/users/jbondc/orgs","repos_url":"https://api.github.com/users/jbondc/repos","events_url":"https://api.github.com/users/jbondc/events{/privacy}","received_events_url":"https://api.github.com/users/jbondc/received_events","type":"User","site_admin":false},"body":"If there's a BC concern I guess I could emit:\r\n```\r\n     E9[E9[\"A\"] = 0] = \"A\";\r\n     E9[\"B\"] = E9.A;\r\n     E9[0] = \"B\";\r\n```\r\n","created_at":"2015-05-17T14:34:21Z","updated_at":"2015-05-17T14:34:21Z","html_url":"https://github.com/Microsoft/TypeScript/pull/3103#discussion_r30470859","pull_request_url":"https://api.github.com/repos/Microsoft/TypeScript/pulls/3103","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/TypeScript/pulls/comments/30470859"},"html":{"href":"https://github.com/Microsoft/TypeScript/pull/3103#discussion_r30470859"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/TypeScript/pulls/3103"}}},"pull_request":{"url":"https://api.github.com/repos/Microsoft/TypeScript/pulls/3103","id":35084917,"html_url":"https://github.com/Microsoft/TypeScript/pull/3103","diff_url":"https://github.com/Microsoft/TypeScript/pull/3103.diff","patch_url":"https://github.com/Microsoft/TypeScript/pull/3103.patch","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/3103","number":3103,"state":"open","locked":false,"title":"Enum improvements","user":{"login":"jbondc","id":199519,"avatar_url":"https://avatars.githubusercontent.com/u/199519?v=3","gravatar_id":"","url":"https://api.github.com/users/jbondc","html_url":"https://github.com/jbondc","followers_url":"https://api.github.com/users/jbondc/followers","following_url":"https://api.github.com/users/jbondc/following{/other_user}","gists_url":"https://api.github.com/users/jbondc/gists{/gist_id}","starred_url":"https://api.github.com/users/jbondc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbondc/subscriptions","organizations_url":"https://api.github.com/users/jbondc/orgs","repos_url":"https://api.github.com/users/jbondc/repos","events_url":"https://api.github.com/users/jbondc/events{/privacy}","received_events_url":"https://api.github.com/users/jbondc/received_events","type":"User","site_admin":false},"body":"Started to look at implementing #1003 and struggled understanding enums.\r\nThis patch addresses the following issues:\r\n- Make ambiant & const enums report similar errors (allow any constant number expression). fixes #2790\r\n- If an invalid enum constant expression is found, continue incrementing with the last valid initialized value.\r\n- If an enum expression references another enum member, then emit a reference to the other value.\r\n\r\nNote that I'm still confused about what 'constant' means for an enum #538\r\nThinking that enum should allow for NumericLiteral, it's an ```enum<number>```. \r\n\r\nYou could have a more restricted/subset enum:\r\n```\r\nenum<int32> a {\r\n  a, // 0\r\n  b, = 1.1 // error, initializer must be a constant expression of type 'int32'\r\n  c, = -1, // ok\r\n  d, // 1\r\n}\r\n```\r\n\r\nOr if you don't want signed:\r\n```\r\nenum<uint32> b {\r\n  a, // 0\r\n  b, = 1.1 // error, initializer must be a constant expression of type 'uint32'\r\n  c, = -1, // error, initializer must be a constant expression of type 'uint32'\r\n  d, // 1\r\n}\r\n```","created_at":"2015-05-10T16:27:25Z","updated_at":"2015-05-17T14:34:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c194b29bd113495176c9a9663ee6d81bad5be094","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/TypeScript/pulls/3103/commits","review_comments_url":"https://api.github.com/repos/Microsoft/TypeScript/pulls/3103/comments","review_comment_url":"https://api.github.com/repos/Microsoft/TypeScript/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/3103/comments","statuses_url":"https://api.github.com/repos/Microsoft/TypeScript/statuses/04a10f553023f12b45bee1746f4c478e37278eba","head":{"label":"jbondc:enumImprovements","ref":"enumImprovements","sha":"04a10f553023f12b45bee1746f4c478e37278eba","user":{"login":"jbondc","id":199519,"avatar_url":"https://avatars.githubusercontent.com/u/199519?v=3","gravatar_id":"","url":"https://api.github.com/users/jbondc","html_url":"https://github.com/jbondc","followers_url":"https://api.github.com/users/jbondc/followers","following_url":"https://api.github.com/users/jbondc/following{/other_user}","gists_url":"https://api.github.com/users/jbondc/gists{/gist_id}","starred_url":"https://api.github.com/users/jbondc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbondc/subscriptions","organizations_url":"https://api.github.com/users/jbondc/orgs","repos_url":"https://api.github.com/users/jbondc/repos","events_url":"https://api.github.com/users/jbondc/events{/privacy}","received_events_url":"https://api.github.com/users/jbondc/received_events","type":"User","site_admin":false},"repo":{"id":24433361,"name":"TypeScript","full_name":"jbondc/TypeScript","owner":{"login":"jbondc","id":199519,"avatar_url":"https://avatars.githubusercontent.com/u/199519?v=3","gravatar_id":"","url":"https://api.github.com/users/jbondc","html_url":"https://github.com/jbondc","followers_url":"https://api.github.com/users/jbondc/followers","following_url":"https://api.github.com/users/jbondc/following{/other_user}","gists_url":"https://api.github.com/users/jbondc/gists{/gist_id}","starred_url":"https://api.github.com/users/jbondc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbondc/subscriptions","organizations_url":"https://api.github.com/users/jbondc/orgs","repos_url":"https://api.github.com/users/jbondc/repos","events_url":"https://api.github.com/users/jbondc/events{/privacy}","received_events_url":"https://api.github.com/users/jbondc/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jbondc/TypeScript","description":"TypeScript is a superset of JavaScript that compiles to clean JavaScript output.","fork":true,"url":"https://api.github.com/repos/jbondc/TypeScript","forks_url":"https://api.github.com/repos/jbondc/TypeScript/forks","keys_url":"https://api.github.com/repos/jbondc/TypeScript/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jbondc/TypeScript/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jbondc/TypeScript/teams","hooks_url":"https://api.github.com/repos/jbondc/TypeScript/hooks","issue_events_url":"https://api.github.com/repos/jbondc/TypeScript/issues/events{/number}","events_url":"https://api.github.com/repos/jbondc/TypeScript/events","assignees_url":"https://api.github.com/repos/jbondc/TypeScript/assignees{/user}","branches_url":"https://api.github.com/repos/jbondc/TypeScript/branches{/branch}","tags_url":"https://api.github.com/repos/jbondc/TypeScript/tags","blobs_url":"https://api.github.com/repos/jbondc/TypeScript/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jbondc/TypeScript/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jbondc/TypeScript/git/refs{/sha}","trees_url":"https://api.github.com/repos/jbondc/TypeScript/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jbondc/TypeScript/statuses/{sha}","languages_url":"https://api.github.com/repos/jbondc/TypeScript/languages","stargazers_url":"https://api.github.com/repos/jbondc/TypeScript/stargazers","contributors_url":"https://api.github.com/repos/jbondc/TypeScript/contributors","subscribers_url":"https://api.github.com/repos/jbondc/TypeScript/subscribers","subscription_url":"https://api.github.com/repos/jbondc/TypeScript/subscription","commits_url":"https://api.github.com/repos/jbondc/TypeScript/commits{/sha}","git_commits_url":"https://api.github.com/repos/jbondc/TypeScript/git/commits{/sha}","comments_url":"https://api.github.com/repos/jbondc/TypeScript/comments{/number}","issue_comment_url":"https://api.github.com/repos/jbondc/TypeScript/issues/comments{/number}","contents_url":"https://api.github.com/repos/jbondc/TypeScript/contents/{+path}","compare_url":"https://api.github.com/repos/jbondc/TypeScript/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jbondc/TypeScript/merges","archive_url":"https://api.github.com/repos/jbondc/TypeScript/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jbondc/TypeScript/downloads","issues_url":"https://api.github.com/repos/jbondc/TypeScript/issues{/number}","pulls_url":"https://api.github.com/repos/jbondc/TypeScript/pulls{/number}","milestones_url":"https://api.github.com/repos/jbondc/TypeScript/milestones{/number}","notifications_url":"https://api.github.com/repos/jbondc/TypeScript/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jbondc/TypeScript/labels{/name}","releases_url":"https://api.github.com/repos/jbondc/TypeScript/releases{/id}","created_at":"2014-09-24T21:29:04Z","updated_at":"2015-02-17T20:56:12Z","pushed_at":"2015-05-12T23:47:28Z","git_url":"git://github.com/jbondc/TypeScript.git","ssh_url":"git@github.com:jbondc/TypeScript.git","clone_url":"https://github.com/jbondc/TypeScript.git","svn_url":"https://github.com/jbondc/TypeScript","homepage":"http://www.typescriptlang.org","size":136982,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Microsoft:master","ref":"master","sha":"681954bc59a58da949de42272333b3b33f72bce9","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":20929025,"name":"TypeScript","full_name":"Microsoft/TypeScript","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/TypeScript","description":"TypeScript is a superset of JavaScript that compiles to clean JavaScript output.","fork":false,"url":"https://api.github.com/repos/Microsoft/TypeScript","forks_url":"https://api.github.com/repos/Microsoft/TypeScript/forks","keys_url":"https://api.github.com/repos/Microsoft/TypeScript/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/TypeScript/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/TypeScript/teams","hooks_url":"https://api.github.com/repos/Microsoft/TypeScript/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/TypeScript/events","assignees_url":"https://api.github.com/repos/Microsoft/TypeScript/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/TypeScript/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/TypeScript/tags","blobs_url":"https://api.github.com/repos/Microsoft/TypeScript/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/TypeScript/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/TypeScript/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/TypeScript/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/TypeScript/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/TypeScript/languages","stargazers_url":"https://api.github.com/repos/Microsoft/TypeScript/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/TypeScript/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/TypeScript/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/TypeScript/subscription","commits_url":"https://api.github.com/repos/Microsoft/TypeScript/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/TypeScript/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/TypeScript/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/TypeScript/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/TypeScript/merges","archive_url":"https://api.github.com/repos/Microsoft/TypeScript/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/TypeScript/downloads","issues_url":"https://api.github.com/repos/Microsoft/TypeScript/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/TypeScript/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/TypeScript/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/TypeScript/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/TypeScript/releases{/id}","created_at":"2014-06-17T15:28:39Z","updated_at":"2015-05-17T13:42:56Z","pushed_at":"2015-05-17T13:11:42Z","git_url":"git://github.com/Microsoft/TypeScript.git","ssh_url":"git@github.com:Microsoft/TypeScript.git","clone_url":"https://github.com/Microsoft/TypeScript.git","svn_url":"https://github.com/Microsoft/TypeScript","homepage":"http://www.typescriptlang.org","size":829498,"stargazers_count":5203,"watchers_count":5203,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":547,"mirror_url":null,"open_issues_count":628,"forks":547,"open_issues":628,"watchers":5203,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/TypeScript/pulls/3103"},"html":{"href":"https://github.com/Microsoft/TypeScript/pull/3103"},"issue":{"href":"https://api.github.com/repos/Microsoft/TypeScript/issues/3103"},"comments":{"href":"https://api.github.com/repos/Microsoft/TypeScript/issues/3103/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/TypeScript/pulls/3103/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/TypeScript/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/TypeScript/pulls/3103/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/TypeScript/statuses/04a10f553023f12b45bee1746f4c478e37278eba"}}}}