-
-
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
Wrong C code generated on operations on sets #16269
Comments
Same as #15435? |
This issues are likely related but the error detected by the C compiler is not the same. As my system is localized, the message is in French. For #15435 the first error is:
With my example, this is:
|
The first error is for the |
I am getting this error on the latest devel, which makes sense.
|
We get this error with version 1.6.0 too. When I wrote that I expected the program to compile without error, I meant that I expected no error when compiling the generated C program. One way to solve this was to introduce some restrictions on types for certain operations, which I understand. So, for me this error makes sense too. |
Thanks for confirming. It then looks like this issue is a duplicate of #15435; can you review the test added for that issue in this PR: https://github.com/nim-lang/Nim/pull/19079/files ? This issue can then be closed if it's a duplicate. |
Yes. It’s a duplicate of #15435. For the test added in the PR, I think that last line is useless as this is line 5 which causes a compilation error. Of course, if we comment lines 5 and 6, this last line will also cause a compilation error. I close the present issue. |
You're right :) I have removed that unnecessary line from that test as it will never be reached. |
The C compiler issues an error when compiling a program which contains operations (for instance, +) on sets with different types.
Example
Current Output
C compiler error encountered on line:
Expected Output
Program compiles without error.
Possible Solution
Do not use operations between a set of a type and a set of a subtype.
Additional Information
Doesn’t work with development version either.
The text was updated successfully, but these errors were encountered: