{"action":"closed","issue":{"url":"https://api.github.com/repos/jameysharp/corrode/issues/107","repository_url":"https://api.github.com/repos/jameysharp/corrode","labels_url":"https://api.github.com/repos/jameysharp/corrode/issues/107/labels{/name}","comments_url":"https://api.github.com/repos/jameysharp/corrode/issues/107/comments","events_url":"https://api.github.com/repos/jameysharp/corrode/issues/107/events","html_url":"https://github.com/jameysharp/corrode/issues/107","id":198786924,"number":107,"title":"Enum values are not handled in constant position","user":{"login":"Marwes","id":957312,"avatar_url":"https://avatars0.githubusercontent.com/u/957312?v=3","gravatar_id":"","url":"https://api.github.com/users/Marwes","html_url":"https://github.com/Marwes","followers_url":"https://api.github.com/users/Marwes/followers","following_url":"https://api.github.com/users/Marwes/following{/other_user}","gists_url":"https://api.github.com/users/Marwes/gists{/gist_id}","starred_url":"https://api.github.com/users/Marwes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Marwes/subscriptions","organizations_url":"https://api.github.com/users/Marwes/orgs","repos_url":"https://api.github.com/users/Marwes/repos","events_url":"https://api.github.com/users/Marwes/events{/privacy}","received_events_url":"https://api.github.com/users/Marwes/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-01-04T19:14:17Z","updated_at":"2017-03-05T06:52:01Z","closed_at":"2017-03-05T06:52:01Z","body":"Tried running corrode on lua but that failed due to its use of enum values to specify array sizes.\r\n\r\n### Input\r\n```c\r\nenum Test {\r\n    X = 1,\r\n};\r\n\r\nstruct Struct {\r\n    char array[X];\r\n};\r\n\r\nstruct Struct test() {\r\n    \r\n}\r\n```\r\n\r\n### Expected\r\n```rust\r\nenum Test {\r\n    X = 1,\r\n}\r\n\r\n#[derive(Clone, Copy)]\r\n#[repr(C)]\r\npub struct Struct {\r\n    pub array : [u8; Test::X as usize],\r\n}\r\n\r\n#[no_mangle]\r\npub unsafe extern fn test() -> Struct { }\r\n```"}}
{"actor":{"display_login":"jameysharp"}}