Thread overview
[Issue 22077] `std.sumtype` support for copy constructors is incomplete
Aug 11, 2021
Paul Backus
Aug 11, 2021
Paul Backus
Aug 11, 2021
Dlang Bot
Aug 12, 2021
Dlang Bot
August 11, 2021
https://issues.dlang.org/show_bug.cgi?id=22077

Paul Backus <snarwin+bugzilla@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |snarwin+bugzilla@gmail.com

--- Comment #1 from Paul Backus <snarwin+bugzilla@gmail.com> ---
The first example looks like a bad error message. The actual problem is that you cannot call a @system copy constructor from @safe code--and indeed, changing main to @system allows the example to compile successfully.

The second example is a mistake in SumType, and should not be difficult to fix.

--
August 11, 2021
https://issues.dlang.org/show_bug.cgi?id=22077

--- Comment #2 from Paul Backus <snarwin+bugzilla@gmail.com> ---
Bad error message submitted as issue 22202.

--
August 11, 2021
https://issues.dlang.org/show_bug.cgi?id=22077

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #3 from Dlang Bot <dlang-bot@dlang.rocks> ---
@pbackus created dlang/phobos pull request #8192 "Fix issue 22077 - `std.sumtype` support for copy constructors is inco…" fixing this issue:

- Fix issue 22077 - `std.sumtype` support for copy constructors is incomplete

  Previously, SumType would define the wrong set of constructors for types
  whose copyability varies depending on their mutability--a situation that
  was impossible with postblits, but is now possible with copy
  constructors.

https://github.com/dlang/phobos/pull/8192

--
August 12, 2021
https://issues.dlang.org/show_bug.cgi?id=22077

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/phobos pull request #8192 "Fix issue 22077 - `std.sumtype` support for copy constructors is inco…" was merged into master:

- cce2d6e926a5147ff9651a2c3fbb10dec59288e4 by Paul Backus:
  Fix issue 22077 - `std.sumtype` support for copy constructors is incomplete

  Previously, SumType would define the wrong set of constructors for types
  whose copyability varies depending on their mutability--a situation that
  was impossible with postblits, but is now possible with copy
  constructors.

https://github.com/dlang/phobos/pull/8192

--