ex_const icon indicating copy to clipboard operation
ex_const copied to clipboard

enum when using only one entry

Open findusOne opened this issue 4 years ago • 1 comments

Hi,

I have been using ex_cont and find it to be very useful. However, I discovered if I define the following: enum test do only_one_entry 0 end

then a compile error "undefined function only_one_entry/1 (there is no such import)" happens.

My workaround is to change the enum like so:

enum test do only_one_entry 0 unused 0xFFFF end

and never use the second entry.

findusOne avatar Mar 21 '22 23:03 findusOne

As an addendum to my previous comments, I found that writing the enum in the form:

enum test, do: [only_one_entry: 0]

works.

findusOne avatar Mar 22 '22 11:03 findusOne

As you figured out, the syntax in your last comment is the correct one.

jcomellas avatar May 06 '24 14:05 jcomellas