{"action":"created","issue":{"url":"https://api.github.com/repos/dart-lang/sdk/issues/29278","repository_url":"https://api.github.com/repos/dart-lang/sdk","labels_url":"https://api.github.com/repos/dart-lang/sdk/issues/29278/labels{/name}","comments_url":"https://api.github.com/repos/dart-lang/sdk/issues/29278/comments","events_url":"https://api.github.com/repos/dart-lang/sdk/issues/29278/events","html_url":"https://github.com/dart-lang/sdk/issues/29278","id":219797533,"node_id":"MDU6SXNzdWUyMTk3OTc1MzM=","number":29278,"title":"enums should be allowed in constant expressions","user":{"login":"Hixie","id":551196,"node_id":"MDQ6VXNlcjU1MTE5Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/551196?v=4","gravatar_id":"","url":"https://api.github.com/users/Hixie","html_url":"https://github.com/Hixie","followers_url":"https://api.github.com/users/Hixie/followers","following_url":"https://api.github.com/users/Hixie/following{/other_user}","gists_url":"https://api.github.com/users/Hixie/gists{/gist_id}","starred_url":"https://api.github.com/users/Hixie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hixie/subscriptions","organizations_url":"https://api.github.com/users/Hixie/orgs","repos_url":"https://api.github.com/users/Hixie/repos","events_url":"https://api.github.com/users/Hixie/events{/privacy}","received_events_url":"https://api.github.com/users/Hixie/received_events","type":"User","site_admin":false},"labels":[{"id":334529267,"node_id":"MDU6TGFiZWwzMzQ1MjkyNjc=","url":"https://api.github.com/repos/dart-lang/sdk/labels/Type:%20enhancement","name":"Type: enhancement","color":"ededed","default":false},{"id":219928175,"node_id":"MDU6TGFiZWwyMTk5MjgxNzU=","url":"https://api.github.com/repos/dart-lang/sdk/labels/area-language","name":"area-language","color":"c7def8","default":false}],"state":"open","locked":false,"assignee":{"login":"lrhn","id":4865287,"node_id":"MDQ6VXNlcjQ4NjUyODc=","avatar_url":"https://avatars3.githubusercontent.com/u/4865287?v=4","gravatar_id":"","url":"https://api.github.com/users/lrhn","html_url":"https://github.com/lrhn","followers_url":"https://api.github.com/users/lrhn/followers","following_url":"https://api.github.com/users/lrhn/following{/other_user}","gists_url":"https://api.github.com/users/lrhn/gists{/gist_id}","starred_url":"https://api.github.com/users/lrhn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lrhn/subscriptions","organizations_url":"https://api.github.com/users/lrhn/orgs","repos_url":"https://api.github.com/users/lrhn/repos","events_url":"https://api.github.com/users/lrhn/events{/privacy}","received_events_url":"https://api.github.com/users/lrhn/received_events","type":"User","site_admin":false},"assignees":[{"login":"lrhn","id":4865287,"node_id":"MDQ6VXNlcjQ4NjUyODc=","avatar_url":"https://avatars3.githubusercontent.com/u/4865287?v=4","gravatar_id":"","url":"https://api.github.com/users/lrhn","html_url":"https://github.com/lrhn","followers_url":"https://api.github.com/users/lrhn/followers","following_url":"https://api.github.com/users/lrhn/following{/other_user}","gists_url":"https://api.github.com/users/lrhn/gists{/gist_id}","starred_url":"https://api.github.com/users/lrhn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lrhn/subscriptions","organizations_url":"https://api.github.com/users/lrhn/orgs","repos_url":"https://api.github.com/users/lrhn/repos","events_url":"https://api.github.com/users/lrhn/events{/privacy}","received_events_url":"https://api.github.com/users/lrhn/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2017-04-06T06:20:47Z","updated_at":"2018-06-29T01:58:50Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"It's common in Flutter code to use enums heavily. Since these are always entirely known at compile time, it is unfortunate that they cannot be used in constant expressions. (Constant expressions with enums would allow us to assert things about arguments based on enums in constant constructors which would allow big performance wins in widget trees which could be constant in principle but can't today because of this issue.)\r\n```dart\r\nenum X { a, b }\r\nconst bool foo = X.a == X.b; // <-- won't compile\r\nvoid main() {\r\n  print(foo);\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/dart-lang/sdk/issues/comments/401224699","html_url":"https://github.com/dart-lang/sdk/issues/29278#issuecomment-401224699","issue_url":"https://api.github.com/repos/dart-lang/sdk/issues/29278","id":401224699,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMTIyNDY5OQ==","user":{"login":"srawlins","id":103167,"node_id":"MDQ6VXNlcjEwMzE2Nw==","avatar_url":"https://avatars3.githubusercontent.com/u/103167?v=4","gravatar_id":"","url":"https://api.github.com/users/srawlins","html_url":"https://github.com/srawlins","followers_url":"https://api.github.com/users/srawlins/followers","following_url":"https://api.github.com/users/srawlins/following{/other_user}","gists_url":"https://api.github.com/users/srawlins/gists{/gist_id}","starred_url":"https://api.github.com/users/srawlins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srawlins/subscriptions","organizations_url":"https://api.github.com/users/srawlins/orgs","repos_url":"https://api.github.com/users/srawlins/repos","events_url":"https://api.github.com/users/srawlins/events{/privacy}","received_events_url":"https://api.github.com/users/srawlins/received_events","type":"User","site_admin":false},"created_at":"2018-06-29T01:58:50Z","updated_at":"2018-06-29T01:58:50Z","author_association":"MEMBER","body":"Not sure when this changed, but this now works in the VM 😕 . It does not work [in dart2js](https://dartpad.dartlang.org/831264cd34821de8bc5552f1b97b669e), and the analyzer is unhappy about it still."}}
{"actor":{"display_login":"srawlins"}}