-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Compiler crashes when using string as object variant selector with else branch #14189
Comments
I believe the consensus is that strings should be disallowed in object variant typedefs. A pull to that effect would let us measure breakage, to some extent. It might need a documentation update, too. |
Strings in object variants are not documented, so no need to update anything there. From the manual:
This error message is just randomly misleading. It's really easy to remove it, someone can make a PR with the proposed change above if they want |
Example
Current Output
Expected Output
Compiles or disallowed. There is an error message that says
Error: selector must be of an ordinal type, float or string
if you make the selector type anything but those types.Possible Solution
To disallow, change:
Nim/compiler/semtypes.nim
Lines 673 to 681 in 9c33bca
to:
The text was updated successfully, but these errors were encountered: