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

[BUG] Enum member called 's' is not possible #1342

Open
threeifbyair opened this issue Nov 29, 2024 · 1 comment
Open

[BUG] Enum member called 's' is not possible #1342

threeifbyair opened this issue Nov 29, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@threeifbyair
Copy link

Describe the bug
When declaring an enumeration, a member called 's' cannot be declared.

To Reproduce

https://cpp2.godbolt.org/z/eExnreoaT

foo : @enum type = { s; }

gives the following error:

main.cpp2: error: a type's implementation may not declare a name that is the same as (i.e., shadows) a type scope name - for example, a type scope function's local variable may not have the same as one of the type's members

's' is not mentioned among the illegal member names for an enumeration.

@threeifbyair threeifbyair added the bug Something isn't working label Nov 29, 2024
@gregmarr
Copy link
Contributor

I believe that this happens due to these functions:

public: [[nodiscard]] static auto from_string(cpp2::impl::in<std::string_view> s) -> foo;
public: [[nodiscard]] static auto from_code(cpp2::impl::in<std::string_view> s) -> foo;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants