Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enum when using only one entry #3

Closed
findusOne opened this issue Mar 21, 2022 · 2 comments
Closed

enum when using only one entry #3

findusOne opened this issue Mar 21, 2022 · 2 comments

Comments

@findusOne
Copy link

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
Copy link
Author

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

enum test, do: [only_one_entry: 0]

works.

@jcomellas
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants