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

RazvanN <razvan.nitu1...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |razvan.nitu1...@gmail.com

--- Comment #1 from RazvanN <razvan.nitu1...@gmail.com> ---
The problem stems from the fact that `asdasdasd` is a system variable because
it calls `foo` which is system. When the compiler tries to generate opAssign
for ClusterInfoJohan it looks at the attributes of the potential
opAssign/postblits/destructors it might call to deduce the attributes of the
generated opAssign. Since UUID.opAssign is nogc and safe and the rest of the
assignments (for oiuoi and asdasdasd) do not call any other user defined
operators, the compiler wrongfully thinks that the generated opAssign should be
nogc and safe. However, since we are accessing a system variable, it will issue
a deprecation (which is silent normally, because errors are gagged when
analyzing generated functions) which is catched when compiled with -de.

A workaround is to make `foo` @safe. That will make the code to compile.

Patch incoming.

--

Reply via email to