Strange error message with @[flag]
enum
#20924
Labels
Bug
This tag is applied to issues which reports bugs.
Status: Confirmed
This bug has been confirmed to be valid by a contributor.
Unit: Compiler
Bugs/feature requests, that are related to the V compiler in general.
Unit: Parser
Bugs/feature requests, that are related to the V parser or syntax (*not* semantic ones).
Describe the bug
Tried to implement a
has
method on an enum, but ran into a message that it's a duplicate message.Reproduction Steps
Expected Behavior
Clean compile, or details of the actual problem.
Current Behavior
Possible Solution
Turns out, this is because flag enum are currently implemented as bitfields, so the duplication is because of
bitfield.has()
. However, that is not in any way obvious from the error message, regardless of the message showing the wrong section of code.Additional Information/Context
If V is going to complain about this, then
V version
V 0.4.4 d5370bd
Environment details (OS name and version, etc.)
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.
The text was updated successfully, but these errors were encountered: