Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
/ druntime Public archive

TypeInfo.getHash(): use const scope#2139

Merged
dlang-bot merged 1 commit intodlang:masterfrom
WalterBright:getHash-scope
Mar 12, 2018
Merged

TypeInfo.getHash(): use const scope#2139
dlang-bot merged 1 commit intodlang:masterfrom
WalterBright:getHash-scope

Conversation

@WalterBright
Copy link
Member

Start on making TypeInfo methods safe. Should be no problem since users won't be deriving from it.

@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.

Copy link
Contributor

@wilzbach wilzbach left a comment

Choose a reason for hiding this comment

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

Couldn't we fix in with -dip1000 to mean scope const again? At the moment in has become a bit useless ...

src/object.d Outdated
assert(!(flag & (flag - 1)) && !(flag & ~(flag - 1) << 1));
}
do
body
Copy link
Contributor

Choose a reason for hiding this comment

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

Why? Use of body has been deprecated in favor of do with https://github.com/dlang/DIPs/blob/master/DIPs/accepted/DIP1003.md

@WalterBright
Copy link
Member Author

I don't think we can fix in. It may break an astonishing amount of code, since it was never enforced.

@dlang-bot dlang-bot merged commit c05d5de into dlang:master Mar 12, 2018
@WalterBright WalterBright deleted the getHash-scope branch March 12, 2018 22:45
@dnadlinger
Copy link
Contributor

Erm, sure, this change is probably benign, but how do you expect to ever make getHash @safe? The fact that it dereferences a void* will remain a giant safety hole, and we should be transitioning to making it @system instead.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants