Skip to content
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

improve documentation for DsymbolTable #12570

Merged
merged 1 commit into from May 25, 2021
Merged

Conversation

WalterBright
Copy link
Member

Leave it better than I found it.

@WalterBright WalterBright added Easy Review Refactoring No semantic changes to code labels May 24, 2021
@dlang-bot
Copy link
Contributor

Thanks for your pull request, @WalterBright!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#12570"

Dsymbol* ps = tab.getLvalue(ident);
*ps = s;
return s;
*tab.getLvalue(s.ident) = s;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert this, it's not an improvement to the documentation.

(Also forgot to update dsymbol.h...)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is tagged "refactoring".

Updated dsymbol.h.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A refactoring should not change the behavior... Have you checked that this change doesn't affect LDC?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't change the behavior - dmd never calls it. As for gdc/ldc, if they're using the return value, it'll give an error, not silently corrupt anything. The return value makes no sense.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It occurs to me you and I have different interpretations of what "refactoring" means. To me, it means not changing the behavior of the program. To you (correct me if I'm wrong) it means not changing the API of any functions.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refactorings should retain the behavior of a component, it's more nuanced than the whole program but doesn't prohibit changes to function signatures.

The problem here is a change to the public API which can break code depending on "DMD as a library" - without providing any real benefit.

But I guess that is acceptable given that the potential breakage isn't silent and can easily be fixed.

@RazvanN7 RazvanN7 merged commit 7fafcd2 into dlang:master May 25, 2021
UplinkCoder pushed a commit to UplinkCoder/dmd that referenced this pull request Aug 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Easy Review Refactoring No semantic changes to code
Projects
None yet
5 participants