https://issues.dlang.org/show_bug.cgi?id=22041

Dlang Bot <[email protected]> changed:

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

--- Comment #1 from Dlang Bot <[email protected]> ---
@ljmf00 created dlang/phobos pull request #8146 "sumtype: remove forced @system
for opAssign preventing @safe code" fixing this issue:

- sumtype: remove forced @system for opAssign preventing @safe code

  Fixes #22041 .

  D programming language is moving towards @safe code and introducing new
  @system code makes std.sumtype fundamentally useless when using it under
@safe
  code. Forcing @system when the users are using pointers is just wrong.

  The simple example to prove it is the following:

  ```d
  void main() @safe
  {
      int* thisIsNotUnsafe = new int;
  }
  ```

  Using pointers in D is not necessarily @system.

  Moreover, this code is preventing the following code to compile in @safe:

  ```d
  alias FooBar = SumType!string;
  auto foobar = FooBar("foo");
  foobar = FooBar("bar");
  ```

  Signed-off-by: Luís Ferreira <[email protected]>

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

--

Reply via email to