[Issue 20012] export inside mixin doesn't seem to work

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jul 24 23:21:31 UTC 2019


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

--- Comment #21 from Dennis <dkorpel at live.nl> ---
(In reply to Walter Bright from comment #3)
> But there's another way you can do it:
> 
>   mixin template M()
>   {
>     export extern(C) pragma(mangle, "fun") void fun() {}
>   }
>   mixin M!();
> 
> which will work.

That works ad-hoc because C mangling is relatively easy, but it asks the user
to maintain their own C mangling logic, while the compiler should (and does)
provide that.

--


More information about the Digitalmars-d-bugs mailing list