digitalmars.D.learn - Alias parameter + AA + external module
- Dicebot (26/26) Feb 08 2013 == mod.d ==
- bearophile (4/8) Feb 08 2013 I think you have to remove that exclamation mark.
- Dicebot (2/10) Feb 08 2013 Typo, irrelevant to subject.
- monarch_dodra (3/16) Feb 08 2013 Wait, this is giving me a compile error. You are getting a link
- Dicebot (3/5) Feb 08 2013 What compile error do you get? After removing exclamation mark
- monarch_dodra (4/9) Feb 08 2013 I miss-understood you. I thought the ! was the source of the
- Dicebot (2/2) Feb 08 2013 Ok, can't find in bugzilla anything similar, have filed new one:
== 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_D4test4mainFZv3arrHA aiZ4funcMFZv+0x3e): undefined reference to `_D3mod7__arrayZ' collect2: ld returned 1 exit status --- errorlevel 1 This works if I move func to main module. Also works when passing integer variable as an alias param. Also works on x32 linux, but fails on x64. What should I blame and search in bugzilla for? :) My code has used this idiom extensively and encountering this while checking x64 compatibility was an unpleasant surprise :(
Feb 08 2013
Dicebot:void func!(alias arr)() { arr["key"] = 43; }I think you have to remove that exclamation mark. Bye, bearophile
Feb 08 2013
On Friday, 8 February 2013 at 15:20:53 UTC, bearophile wrote:Dicebot:Typo, irrelevant to subject.void func!(alias arr)() { arr["key"] = 43; }I think you have to remove that exclamation mark. Bye, bearophile
Feb 08 2013
On Friday, 8 February 2013 at 15:22:09 UTC, Dicebot wrote:On Friday, 8 February 2013 at 15:20:53 UTC, bearophile wrote:Wait, this is giving me a compile error. You are getting a link error. What's going on?Dicebot:Typo, irrelevant to subject.void func!(alias arr)() { arr["key"] = 43; }I think you have to remove that exclamation mark. Bye, bearophile
Feb 08 2013
On Friday, 8 February 2013 at 15:39:05 UTC, monarch_dodra wrote:Wait, this is giving me a compile error. You are getting a link error. What's going on?What compile error do you get? After removing exclamation mark from func declaration it works as described for me.
Feb 08 2013
On Friday, 8 February 2013 at 16:11:48 UTC, Dicebot wrote:On Friday, 8 February 2013 at 15:39:05 UTC, monarch_dodra wrote:I miss-understood you. I thought the ! was the source of the problem. I'm indeed getting the intended link error without it.Wait, this is giving me a compile error. You are getting a link error. What's going on?What compile error do you get? After removing exclamation mark from func declaration it works as described for me.
Feb 08 2013
Ok, can't find in bugzilla anything similar, have filed new one: http://d.puremagic.com/issues/show_bug.cgi?id=9486
Feb 08 2013