How can we call a func template instance using the Mars vendor already ?

user1234 user1234 at 12.de
Thu Feb 19 18:24:32 UTC 2026


On Thursday, 19 February 2026 at 18:15:41 UTC, monkyyy wrote:
> On Thursday, 19 February 2026 at 18:08:24 UTC, user1234 wrote:
>> 
>>> Error: function `onlineapp.OK` label 
>>> `_D9onlineapp__T2okHVii1ZQjFNaNbNiNfZi` is undefined
>
> mangles suck and need to be updated for tiny details
>
> ```
> module onlineapp;
>
> int ok(int i)(){return i;}
>
> enum mangle=ok!1.mangleof;
> mixin("extern(C) int "~mangle~"();");
>
> void OK()
> {
>     mixin("asm{call "~mangle~";}");
> }
>
> int main()
> {
>     OK();
>     return 0;
> }
> ```

Thanks for your time Adam. I think this is just an example of bug 
in "speculative template instantiation". Curious that this 
happens within a single module tho.


More information about the Digitalmars-d-learn mailing list