-
Notifications
You must be signed in to change notification settings - Fork 63
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
Error raised on ranges used as case statement alternatives #353
Comments
This appears to also be the case for case generate statements and selected expressions. |
Thanks for addressing the issue so quickly @Schottkyc137! Is there any action needed from my end or anything that I can do to help? |
So far there is nothing more, I think. Thanks for the nice issue, I could reproduce the code pretty easily and I also appreciate the research effort that went into it. |
Excellent 👍 No problem at all! I'm glad that the extra detail was useful. |
I've got some code on which VHDL-LS is raising errors. However, I believe the code to be valid, and the code compiles and runs correctly in Vivado simulator (I haven't tested anywhere else).
I'm using VHDL-LS version 0.83.0, and the VHDL-LS VS code extension version 0.7.0.
The Error
The error in question is raised when I use a subtype which is a range, or the range attribute of that subtype, as the choice for a case statement alternative. I can't publish my source code, but I've created a MRE which exhibits the problem:
Here is the same code in my editor, to show the error highlights:
Here are the details of the errors raised:
My Justification
As mentioned above, I believe these errors to be raised incorrectly. Here are some excerpts from the VHDL-2008 LRM which lead me to believe that the code is valid:
First we need to get from a case statement down to a choice:
Now the definition for a choice shows that a discrete range is a valid choice, and the definition for a discrete range shows that I can use either a subtype indication (as long as it is a discrete subtype) or a range.
Finally, from section 5.2.1, my enum types and ranges are discrete types and ranges:
With all of this in mind, I believe that my usage of an enum subtype, or the range attribute of that subtype are valid VHDL code and that the "mismatched_kind" errors reported here by VHDL-LS are incorrect. Unless anyone disagrees with that, I would be very grateful if the tool could be updated to handle this code correctly.
The text was updated successfully, but these errors were encountered: