{"action":"created","comment":{"url":"https://api.github.com/repos/ethereum/solidity/pulls/comments/87160292","pull_request_review_id":7782466,"id":87160292,"diff_hunk":"@@ -3314,6 +3314,35 @@ BOOST_AUTO_TEST_CASE(using_enums)\n \tBOOST_CHECK(callContractFunction(\"getChoice()\") == encodeArgs(2));\n }\n \n+BOOST_AUTO_TEST_CASE(enum_explicit_overflow)\n+{\n+\tchar const* sourceCode = R\"(\n+\t\t\tcontract test {\n+\t\t\t\tenum ActionChoices { GoLeft, GoRight, GoStraight }\n+\t\t\t\tenum Dummy { Dummy0, Dummy1, Dummy2, Dummy3 }\n+\t\t\t\tfunction test()\n+\t\t\t\t{\n+\t\t\t\t}\n+\t\t\t\tfunction getChoiceExp() returns (uint d)\n+\t\t\t\t{\n+\t\t\t\t\tchoices = ActionChoices(3);\n+\t\t\t\t\td = uint256(choices);\n+\t\t\t\t}\n+\t\t\t\tfunction getChoiceFromEnum() returns (uint d)\n+\t\t\t\t{\n+\t\t\t\t\tchoices = ActionChoices(Dummy.Dummy3);\n+\t\t\t\t\td = uint256(choices);\n+\t\t\t\t}\n+\t\t\t\tActionChoices choices;\n+\t\t\t}\n+\t)\";\n+\tcompileAndRun(sourceCode);\n+\t// throws\n+\tBOOST_CHECK(callContractFunction(\"getChoiceExp()\") == encodeArgs());\n+\t// also throws\n+\tBOOST_CHECK(callContractFunction(\"getChoiceFromEnum()\") == encodeArgs());","path":"test/libsolidity/SolidityEndToEndTest.cpp","position":null,"original_position":30,"commit_id":"e6974b59b9ebfd43fd1665b1ef3115b3f437d834","original_commit_id":"c1f59e5ff174f570cdd8a41aa2f896e116dde7df","user":{"login":"pirapira","id":44281,"avatar_url":"https://avatars.githubusercontent.com/u/44281?v=3","gravatar_id":"","url":"https://api.github.com/users/pirapira","html_url":"https://github.com/pirapira","followers_url":"https://api.github.com/users/pirapira/followers","following_url":"https://api.github.com/users/pirapira/following{/other_user}","gists_url":"https://api.github.com/users/pirapira/gists{/gist_id}","starred_url":"https://api.github.com/users/pirapira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pirapira/subscriptions","organizations_url":"https://api.github.com/users/pirapira/orgs","repos_url":"https://api.github.com/users/pirapira/repos","events_url":"https://api.github.com/users/pirapira/events{/privacy}","received_events_url":"https://api.github.com/users/pirapira/received_events","type":"User","site_admin":false},"body":"I added success cases.","created_at":"2016-11-09T09:49:58Z","updated_at":"2016-11-09T09:49:58Z","html_url":"https://github.com/ethereum/solidity/pull/1334#discussion_r87160292","pull_request_url":"https://api.github.com/repos/ethereum/solidity/pulls/1334","_links":{"self":{"href":"https://api.github.com/repos/ethereum/solidity/pulls/comments/87160292"},"html":{"href":"https://github.com/ethereum/solidity/pull/1334#discussion_r87160292"},"pull_request":{"href":"https://api.github.com/repos/ethereum/solidity/pulls/1334"}}},"pull_request":{"url":"https://api.github.com/repos/ethereum/solidity/pulls/1334","id":92625638,"html_url":"https://github.com/ethereum/solidity/pull/1334","diff_url":"https://github.com/ethereum/solidity/pull/1334.diff","patch_url":"https://github.com/ethereum/solidity/pull/1334.patch","issue_url":"https://api.github.com/repos/ethereum/solidity/issues/1334","number":1334,"state":"open","locked":false,"title":"check enum value range during conversion","user":{"login":"pirapira","id":44281,"avatar_url":"https://avatars.githubusercontent.com/u/44281?v=3","gravatar_id":"","url":"https://api.github.com/users/pirapira","html_url":"https://github.com/pirapira","followers_url":"https://api.github.com/users/pirapira/followers","following_url":"https://api.github.com/users/pirapira/following{/other_user}","gists_url":"https://api.github.com/users/pirapira/gists{/gist_id}","starred_url":"https://api.github.com/users/pirapira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pirapira/subscriptions","organizations_url":"https://api.github.com/users/pirapira/orgs","repos_url":"https://api.github.com/users/pirapira/repos","events_url":"https://api.github.com/users/pirapira/events{/privacy}","received_events_url":"https://api.github.com/users/pirapira/received_events","type":"User","site_admin":false},"body":"Fixes #1311","created_at":"2016-11-07T17:18:01Z","updated_at":"2016-11-09T09:49:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fe57791f1ec779f8bf227c922f77e3a546be8a94","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ethereum/solidity/pulls/1334/commits","review_comments_url":"https://api.github.com/repos/ethereum/solidity/pulls/1334/comments","review_comment_url":"https://api.github.com/repos/ethereum/solidity/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ethereum/solidity/issues/1334/comments","statuses_url":"https://api.github.com/repos/ethereum/solidity/statuses/e6974b59b9ebfd43fd1665b1ef3115b3f437d834","head":{"label":"ethereum:enum_conversion","ref":"enum_conversion","sha":"e6974b59b9ebfd43fd1665b1ef3115b3f437d834","user":{"login":"ethereum","id":6250754,"avatar_url":"https://avatars.githubusercontent.com/u/6250754?v=3","gravatar_id":"","url":"https://api.github.com/users/ethereum","html_url":"https://github.com/ethereum","followers_url":"https://api.github.com/users/ethereum/followers","following_url":"https://api.github.com/users/ethereum/following{/other_user}","gists_url":"https://api.github.com/users/ethereum/gists{/gist_id}","starred_url":"https://api.github.com/users/ethereum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethereum/subscriptions","organizations_url":"https://api.github.com/users/ethereum/orgs","repos_url":"https://api.github.com/users/ethereum/repos","events_url":"https://api.github.com/users/ethereum/events{/privacy}","received_events_url":"https://api.github.com/users/ethereum/received_events","type":"Organization","site_admin":false},"repo":{"id":40892817,"name":"solidity","full_name":"ethereum/solidity","owner":{"login":"ethereum","id":6250754,"avatar_url":"https://avatars.githubusercontent.com/u/6250754?v=3","gravatar_id":"","url":"https://api.github.com/users/ethereum","html_url":"https://github.com/ethereum","followers_url":"https://api.github.com/users/ethereum/followers","following_url":"https://api.github.com/users/ethereum/following{/other_user}","gists_url":"https://api.github.com/users/ethereum/gists{/gist_id}","starred_url":"https://api.github.com/users/ethereum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethereum/subscriptions","organizations_url":"https://api.github.com/users/ethereum/orgs","repos_url":"https://api.github.com/users/ethereum/repos","events_url":"https://api.github.com/users/ethereum/events{/privacy}","received_events_url":"https://api.github.com/users/ethereum/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ethereum/solidity","description":"The Solidity Contract-Oriented Programming Language","fork":false,"url":"https://api.github.com/repos/ethereum/solidity","forks_url":"https://api.github.com/repos/ethereum/solidity/forks","keys_url":"https://api.github.com/repos/ethereum/solidity/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ethereum/solidity/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ethereum/solidity/teams","hooks_url":"https://api.github.com/repos/ethereum/solidity/hooks","issue_events_url":"https://api.github.com/repos/ethereum/solidity/issues/events{/number}","events_url":"https://api.github.com/repos/ethereum/solidity/events","assignees_url":"https://api.github.com/repos/ethereum/solidity/assignees{/user}","branches_url":"https://api.github.com/repos/ethereum/solidity/branches{/branch}","tags_url":"https://api.github.com/repos/ethereum/solidity/tags","blobs_url":"https://api.github.com/repos/ethereum/solidity/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ethereum/solidity/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ethereum/solidity/git/refs{/sha}","trees_url":"https://api.github.com/repos/ethereum/solidity/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ethereum/solidity/statuses/{sha}","languages_url":"https://api.github.com/repos/ethereum/solidity/languages","stargazers_url":"https://api.github.com/repos/ethereum/solidity/stargazers","contributors_url":"https://api.github.com/repos/ethereum/solidity/contributors","subscribers_url":"https://api.github.com/repos/ethereum/solidity/subscribers","subscription_url":"https://api.github.com/repos/ethereum/solidity/subscription","commits_url":"https://api.github.com/repos/ethereum/solidity/commits{/sha}","git_commits_url":"https://api.github.com/repos/ethereum/solidity/git/commits{/sha}","comments_url":"https://api.github.com/repos/ethereum/solidity/comments{/number}","issue_comment_url":"https://api.github.com/repos/ethereum/solidity/issues/comments{/number}","contents_url":"https://api.github.com/repos/ethereum/solidity/contents/{+path}","compare_url":"https://api.github.com/repos/ethereum/solidity/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ethereum/solidity/merges","archive_url":"https://api.github.com/repos/ethereum/solidity/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ethereum/solidity/downloads","issues_url":"https://api.github.com/repos/ethereum/solidity/issues{/number}","pulls_url":"https://api.github.com/repos/ethereum/solidity/pulls{/number}","milestones_url":"https://api.github.com/repos/ethereum/solidity/milestones{/number}","notifications_url":"https://api.github.com/repos/ethereum/solidity/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ethereum/solidity/labels{/name}","releases_url":"https://api.github.com/repos/ethereum/solidity/releases{/id}","deployments_url":"https://api.github.com/repos/ethereum/solidity/deployments","created_at":"2015-08-17T12:27:26Z","updated_at":"2016-11-08T15:51:47Z","pushed_at":"2016-11-09T09:49:31Z","git_url":"git://github.com/ethereum/solidity.git","ssh_url":"git@github.com:ethereum/solidity.git","clone_url":"https://github.com/ethereum/solidity.git","svn_url":"https://github.com/ethereum/solidity","homepage":"","size":16829,"stargazers_count":453,"watchers_count":453,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":209,"mirror_url":null,"open_issues_count":237,"forks":209,"open_issues":237,"watchers":453,"default_branch":"develop"}},"base":{"label":"ethereum:develop","ref":"develop","sha":"6f2bc0d20150204c33d3ec8747e92a43ad54ab46","user":{"login":"ethereum","id":6250754,"avatar_url":"https://avatars.githubusercontent.com/u/6250754?v=3","gravatar_id":"","url":"https://api.github.com/users/ethereum","html_url":"https://github.com/ethereum","followers_url":"https://api.github.com/users/ethereum/followers","following_url":"https://api.github.com/users/ethereum/following{/other_user}","gists_url":"https://api.github.com/users/ethereum/gists{/gist_id}","starred_url":"https://api.github.com/users/ethereum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethereum/subscriptions","organizations_url":"https://api.github.com/users/ethereum/orgs","repos_url":"https://api.github.com/users/ethereum/repos","events_url":"https://api.github.com/users/ethereum/events{/privacy}","received_events_url":"https://api.github.com/users/ethereum/received_events","type":"Organization","site_admin":false},"repo":{"id":40892817,"name":"solidity","full_name":"ethereum/solidity","owner":{"login":"ethereum","id":6250754,"avatar_url":"https://avatars.githubusercontent.com/u/6250754?v=3","gravatar_id":"","url":"https://api.github.com/users/ethereum","html_url":"https://github.com/ethereum","followers_url":"https://api.github.com/users/ethereum/followers","following_url":"https://api.github.com/users/ethereum/following{/other_user}","gists_url":"https://api.github.com/users/ethereum/gists{/gist_id}","starred_url":"https://api.github.com/users/ethereum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethereum/subscriptions","organizations_url":"https://api.github.com/users/ethereum/orgs","repos_url":"https://api.github.com/users/ethereum/repos","events_url":"https://api.github.com/users/ethereum/events{/privacy}","received_events_url":"https://api.github.com/users/ethereum/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ethereum/solidity","description":"The Solidity Contract-Oriented Programming Language","fork":false,"url":"https://api.github.com/repos/ethereum/solidity","forks_url":"https://api.github.com/repos/ethereum/solidity/forks","keys_url":"https://api.github.com/repos/ethereum/solidity/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ethereum/solidity/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ethereum/solidity/teams","hooks_url":"https://api.github.com/repos/ethereum/solidity/hooks","issue_events_url":"https://api.github.com/repos/ethereum/solidity/issues/events{/number}","events_url":"https://api.github.com/repos/ethereum/solidity/events","assignees_url":"https://api.github.com/repos/ethereum/solidity/assignees{/user}","branches_url":"https://api.github.com/repos/ethereum/solidity/branches{/branch}","tags_url":"https://api.github.com/repos/ethereum/solidity/tags","blobs_url":"https://api.github.com/repos/ethereum/solidity/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ethereum/solidity/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ethereum/solidity/git/refs{/sha}","trees_url":"https://api.github.com/repos/ethereum/solidity/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ethereum/solidity/statuses/{sha}","languages_url":"https://api.github.com/repos/ethereum/solidity/languages","stargazers_url":"https://api.github.com/repos/ethereum/solidity/stargazers","contributors_url":"https://api.github.com/repos/ethereum/solidity/contributors","subscribers_url":"https://api.github.com/repos/ethereum/solidity/subscribers","subscription_url":"https://api.github.com/repos/ethereum/solidity/subscription","commits_url":"https://api.github.com/repos/ethereum/solidity/commits{/sha}","git_commits_url":"https://api.github.com/repos/ethereum/solidity/git/commits{/sha}","comments_url":"https://api.github.com/repos/ethereum/solidity/comments{/number}","issue_comment_url":"https://api.github.com/repos/ethereum/solidity/issues/comments{/number}","contents_url":"https://api.github.com/repos/ethereum/solidity/contents/{+path}","compare_url":"https://api.github.com/repos/ethereum/solidity/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ethereum/solidity/merges","archive_url":"https://api.github.com/repos/ethereum/solidity/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ethereum/solidity/downloads","issues_url":"https://api.github.com/repos/ethereum/solidity/issues{/number}","pulls_url":"https://api.github.com/repos/ethereum/solidity/pulls{/number}","milestones_url":"https://api.github.com/repos/ethereum/solidity/milestones{/number}","notifications_url":"https://api.github.com/repos/ethereum/solidity/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ethereum/solidity/labels{/name}","releases_url":"https://api.github.com/repos/ethereum/solidity/releases{/id}","deployments_url":"https://api.github.com/repos/ethereum/solidity/deployments","created_at":"2015-08-17T12:27:26Z","updated_at":"2016-11-08T15:51:47Z","pushed_at":"2016-11-09T09:49:31Z","git_url":"git://github.com/ethereum/solidity.git","ssh_url":"git@github.com:ethereum/solidity.git","clone_url":"https://github.com/ethereum/solidity.git","svn_url":"https://github.com/ethereum/solidity","homepage":"","size":16829,"stargazers_count":453,"watchers_count":453,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":209,"mirror_url":null,"open_issues_count":237,"forks":209,"open_issues":237,"watchers":453,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/ethereum/solidity/pulls/1334"},"html":{"href":"https://github.com/ethereum/solidity/pull/1334"},"issue":{"href":"https://api.github.com/repos/ethereum/solidity/issues/1334"},"comments":{"href":"https://api.github.com/repos/ethereum/solidity/issues/1334/comments"},"review_comments":{"href":"https://api.github.com/repos/ethereum/solidity/pulls/1334/comments"},"review_comment":{"href":"https://api.github.com/repos/ethereum/solidity/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ethereum/solidity/pulls/1334/commits"},"statuses":{"href":"https://api.github.com/repos/ethereum/solidity/statuses/e6974b59b9ebfd43fd1665b1ef3115b3f437d834"}}}}
{"actor":{"display_login":"pirapira"}}