Thread overview
[Issue 20079] [2.087.0] Forward declaration of functions defined in mixin templates don't compile
Jul 24, 2019
Ethan Watson
Mar 20, 2020
jacob
Mar 25, 2022
RazvanN
July 24, 2019
https://issues.dlang.org/show_bug.cgi?id=20079

--- Comment #1 from Ethan Watson <gooberman@gmail.com> ---
Created attachment 1757
  --> https://issues.dlang.org/attachment.cgi?id=1757&action=edit
Code example

--
March 20, 2020
https://issues.dlang.org/show_bug.cgi?id=20079

jacob <look.at.me.pee.please@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |look.at.me.pee.please@gmail
                   |                            |.com

--- Comment #2 from jacob <look.at.me.pee.please@gmail.com> ---
This isn't a bug, it is intended behavior. A mixin shouldn't overwrite a function in that way. Mixins aren't macros, they have limitations so that it doesn't unexpectedly change the meaning of something else.

Just don't include the forward declare. But something tells me you want to have that behavior, such that forward declare would link to an external C++ function or something, unless that mixin defines the function of the body. It would then link to the D version?

--
March 25, 2022
https://issues.dlang.org/show_bug.cgi?id=20079

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |razvan.nitu1305@gmail.com
         Resolution|---                         |WONTFIX

--- Comment #3 from RazvanN <razvan.nitu1305@gmail.com> ---
Yes, as jacob has mentioned this is intended behavior.

--