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
Fix issue 6227 - Disallow comparison of different enums #6444
Conversation
|
Disallow -> Deprecate |
Also a changelog notice that this got deprecated would be nice. |
@@ -8,7 +8,7 @@ r ARG1 ARG2 | |||
echo RESULT= | |||
p args | |||
--- | |||
GDB_MATCH: RESULT=.*ARG1.*ARG2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
???
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad. Since the array contains the full path as zero-eth element gdb decides to split the content over many lines, making the regex fail. I've never bothered to submit a fixed test and I guess this is the right moment to do so.
Seems like it triggered on assignment as well. |
Not quite, what you see in Wrt extending this rule to the other binary operations I think that's the next logical step and can be easily added at a later time to this PR, at least once/if the team and community approves this idea. |
As an added bonus this change allows us to easily fix b16083: in the example provided both the |
Hey guys, whats going on with this PR? |
One issue with this is if one wants to compare such issues, a cast becomes necessary. Casts are dangerous creatures, in that if the underlying types shift, all kinds of hidden problems can emerge (like unintended truncation). |
We plan to get this fixed. @LemonBoy are you around? Rebase please? |
@@ -15682,6 +15682,12 @@ extern (C++) final class EqualExp : BinExp | |||
if (e1.op == TOKtype || e2.op == TOKtype) | |||
return incompatibleTypes(); | |||
|
|||
auto t1 = e1.type; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
t1 and t2
are either already used or getting used futher down.
I recommend scopeing {
them in a bock }
Since @LemonBoy seems to not be around, @UplinkCoder could you please take this over? Please let us know. Thanks! |
@UplinkCoder thx! @LemonBoy you're always welcome around! |
This is only for named enums, the anonymous ones are currently typed as their own base type and we can't do much about those at least with the way the anonymous enums are handled by the frontend.
So let's do it, one step a time!
There are no regressions in phobos or druntime which is a green flag, let's see what you (and the auto tester) has to say about this change.