-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Analyzer CLI no longer detects duplicate parts #26692
Comments
The test Language/Libraries_and_Scripts/Parts/compilation_t01 also fails. It no longer detects that the same function is declared in both the part and the main file. |
BUG=#26692 R=sgjesse@google.com, scheglov@google.com Review URL: https://codereview.chromium.org/2062803002 .
No, it isn't intended. |
That's strange. And these tests pass even now, after I rollback the status suppression.
They also work in manual testing:
|
Yes, these are being flakey on the buildbot. So there may be some race condition, or timing, that affects this. I'll think about ways to reproduce this. This is on linux, btw, so maybe it doesn't happen on mac. |
As I can see, the specification does not disallow referring to the same part twice. We started discussing this, but there was no resolution, and the specification has not been changes yet. It seems like a right thing to do. |
The language team is in charge of the specification, and they are already considering changing parts to use URI's rather than names, which will resolve this issue. |
Will it? This issue is not about |
Oh, sorry, I didn't read carefully enough. No, this is unrelated. I'll send an e-mail to the language team. |
There are basically three solutions:
The third is what we do for libraries - if you import the same library twice, it works because both imported names refer to the same declaration. I think we can do something similar for part inclusions. The second is what the current specification give us. If you include the contents of the part file twice, it means that its declarations are declared twice in the same scope. Well, maybe, it's not precisely specified what
really means, but it would not be an incorrect interpretation. Then again, no real program would be affected by just disallowing it, so that might just be easier. |
I would be in favor of disallowing it. |
The co19 test Language/Libraries_and_Scripts/Parts/compilation_t02 now fails on the analyzer, because the command-line analyzer no longer detects that the same part is included twice after cache dependencies are no longer checked, a change introduced in
https://codereview.chromium.org/2058253002
Is this intended?
@scheglov @bwilkerson
The text was updated successfully, but these errors were encountered: