{"action":"created","issue":{"url":"https://api.github.com/repos/ark-lang/ark/issues/642","labels_url":"https://api.github.com/repos/ark-lang/ark/issues/642/labels{/name}","comments_url":"https://api.github.com/repos/ark-lang/ark/issues/642/comments","events_url":"https://api.github.com/repos/ark-lang/ark/issues/642/events","html_url":"https://github.com/ark-lang/ark/pull/642","id":128009990,"number":642,"title":"Add binary comparator for non-simple enums","user":{"login":"Acconut","id":1375043,"avatar_url":"https://avatars.githubusercontent.com/u/1375043?v=3","gravatar_id":"","url":"https://api.github.com/users/Acconut","html_url":"https://github.com/Acconut","followers_url":"https://api.github.com/users/Acconut/followers","following_url":"https://api.github.com/users/Acconut/following{/other_user}","gists_url":"https://api.github.com/users/Acconut/gists{/gist_id}","starred_url":"https://api.github.com/users/Acconut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Acconut/subscriptions","organizations_url":"https://api.github.com/users/Acconut/orgs","repos_url":"https://api.github.com/users/Acconut/repos","events_url":"https://api.github.com/users/Acconut/events{/privacy}","received_events_url":"https://api.github.com/users/Acconut/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-01-21T20:14:53Z","updated_at":"2016-01-21T21:04:45Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ark-lang/ark/pulls/642","html_url":"https://github.com/ark-lang/ark/pull/642","diff_url":"https://github.com/ark-lang/ark/pull/642.diff","patch_url":"https://github.com/ark-lang/ark/pull/642.patch"},"body":"This change implements the `==` and `!=` operators for non-simple enums which may have an additional tuple or struct value. Previously the `enum_comp` test case would fail:\r\n\r\n```\r\nerror: [enum-comp:7:9] Operands for binary operator `==` must be numeric, or pointers or booleans, have `Entry`\r\n  print(n == Entry::None);\r\n```\r\n\r\nAt the moment, only the tag is compared and not the optional content of the enum:\r\n```\r\nEntry::Value(1) == Entry::Value(2) // true;\r\n```\r\nHowever, there are cases in which this behaviour is wanted.\r\n"},"comment":{"url":"https://api.github.com/repos/ark-lang/ark/issues/comments/173707310","html_url":"https://github.com/ark-lang/ark/pull/642#issuecomment-173707310","issue_url":"https://api.github.com/repos/ark-lang/ark/issues/642","id":173707310,"user":{"login":"MovingtoMars","id":596124,"avatar_url":"https://avatars.githubusercontent.com/u/596124?v=3","gravatar_id":"","url":"https://api.github.com/users/MovingtoMars","html_url":"https://github.com/MovingtoMars","followers_url":"https://api.github.com/users/MovingtoMars/followers","following_url":"https://api.github.com/users/MovingtoMars/following{/other_user}","gists_url":"https://api.github.com/users/MovingtoMars/gists{/gist_id}","starred_url":"https://api.github.com/users/MovingtoMars/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MovingtoMars/subscriptions","organizations_url":"https://api.github.com/users/MovingtoMars/orgs","repos_url":"https://api.github.com/users/MovingtoMars/repos","events_url":"https://api.github.com/users/MovingtoMars/events{/privacy}","received_events_url":"https://api.github.com/users/MovingtoMars/received_events","type":"User","site_admin":false},"created_at":"2016-01-21T21:04:44Z","updated_at":"2016-01-21T21:04:44Z","body":"We could allow casting an enum type to `int`, to get the discriminant, even if it has other fields."}}