I am not sure what is exactly to blame and this could not find if there exists issue on topic. Simple reproducible test case:
== mod.d ==
void func(alias arr)()
{
arr["key"] = 43;
}
== test.d ==
import mod;
void main()
{
auto arr = [ "key" : 42 ];
func!(arr)();
}
== shell ==
$ rdmd test.d
.../test.o: In function
`_D4test4mainFZv36__T4funcS24_D4test4mainFZv3arrHAyaiZ4funcMFZv':
test.d:(.text._D4test4mainFZv36__T4funcS24_D4test4mainFZv3arrHAyaiZ4funcMFZv+0x3e):
undefined reference to `_D3mod7__arrayZ'
collect2: ld returned 1 exit status
--- errorlevel 1
It will work if I do _any one_ following:
* Move func to test.d
* Alias integer variable
* Compile for x32 Linux
But on x64 this exact code results in provided error message upon linking.
Comment #1 by robert.schadek — 2024-12-13T18:04:06Z