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

fix Issue 18484 - [dip1000] Subtype allows reference to escape with i… #8036

Merged
merged 1 commit into from Mar 16, 2018

Conversation

WalterBright
Copy link
Member

…mplicit casting

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @WalterBright!

Bugzilla references

Auto-close Bugzilla Severity Description
18484 major [dip1000] Subtype allows reference to escape with implicit casting

int* test2()
{
return S().bar(); // error
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This code is not marked as @safe, how come it errors out ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because it's obviously wrong. Even unsafe code gets some checks!

Copy link
Contributor

Choose a reason for hiding this comment

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

So far, DIP1000 only affected @safe code (or at least that was the state intention). It looks like this change also change behavior in non-@safe code, which is very odd to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants