Enum values set with constants calculated with $if/$else can result in duplicated values #23348
Labels
Bug
This tag is applied to issues which reports bugs.
Unit: Checker
Bugs/feature requests, that are related to the type checker.
Describe the bug
Two constants are calculated with
$if/$else
. The constants are used to set the values of two enum elements. After$if/$else
the values can be equal and the enum consistency is not checked for repetition.Reproduction Steps
Expected Behavior
Prevent duplicated values in the enum.
Current Behavior
Enum can get duplicated values which by definition is invalid.
Possible Solution
No response
Additional Information/Context
Previously mentioned in: #23336
V version
V 0.4.9 c50d4ee
Environment details (OS name and version, etc.)
https://play.vlang.io/p/028f55a768
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.
Huly®: V_0.6-21779
The text was updated successfully, but these errors were encountered: