corrode icon indicating copy to clipboard operation
corrode copied to clipboard

Attempt to initialize static enums

Open UncombedCoconut opened this issue 7 years ago • 0 comments

Input: static enum AB {A, B} ab; Output: "Corrode doesn't handle this yet: { }". Proposed output: ..., static mut ab : AB = _AB::A;.

(This happened more naturally in the wild: static instance of a struct, one of whose members was an enum type.)

Related situations: If there's no zero value (static enum AB {A=1, B=2} ab;) I suppose an error is better than making one up. If there are multiple, it's better to worry after Corrode has a way to avoid Rust errors like "discriminant value 0i32 already exists".

UncombedCoconut avatar Jan 13 '18 17:01 UncombedCoconut