Skip to content

Fix Issue 22225 - SumType: Some assignments should be able to execute…#8201

Merged
dlang-bot merged 1 commit intodlang:masterfrom
pbackus:fix-22225
Aug 19, 2021
Merged

Fix Issue 22225 - SumType: Some assignments should be able to execute…#8201
dlang-bot merged 1 commit intodlang:masterfrom
pbackus:fix-22225

Conversation

@pbackus
Copy link
Contributor

@pbackus pbackus commented Aug 19, 2021

… in safe code

@dlang-bot
Copy link
Contributor

Thanks for your pull request and interest in making D better, @pbackus! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Auto-close Bugzilla Severity Description
22225 enhancement SumType: Some assignments should be able to execute in safe code

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 + phobos#8201"

@dlang-bot dlang-bot merged commit f96f804 into dlang:master Aug 19, 2021
pbackus added a commit to pbackus/sumtype that referenced this pull request Aug 20, 2021
Overwriting a SumType's value with a pointer can be @safe so long as the
old value is known, at compile time, to be either (a) a non-pointer, or
(b) a pointer of the same type as the new value. This change allows such
assignments in @safe code, while still forbidding other assignments that
overwrite pointers.

See also:
  - https://issues.dlang.org/show_bug.cgi?id=22225
  - dlang/phobos#8201

Fixes #67 on Github.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants