[Issue 6425] New: Cannot foreach over AA with char as key type
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Aug 1 09:37:40 PDT 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6425
Summary: Cannot foreach over AA with char as key type
Product: D
Version: D2
Platform: Other
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: Optlink
AssignedTo: nobody at puremagic.com
ReportedBy: ruzicic.aleksandar at gmail.com
--- Comment #0 from Aleksandar Ruzicic <ruzicic.aleksandar at gmail.com> 2011-08-01 18:37:36 CEST ---
This code:
--------------------------------------
string[char] aa = [
'f': "foo",
'b': "bar"
];
foreach (ch, str; aa) {
writefln("[%s]: [%s]", ch, str);
}
--------------------------------------
Compiles fine but optlink complains:
OPTLINK (R) for Win32 Release 8.00.12
Copyright (C) Digital Mars 1989-2010 All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
test.obj(test)
Error 42: Symbol Undefined
_D6object28__T16AssociativeArrayTaTAyaZ16AssociativeArray7opApplyMFMDFKaKAyaZiZi
--- errorlevel 1
while this compiles and links without problem:
--------------------------------------
string[string] aa = [
"f": "foo",
"b": "bar"
];
foreach (ch, str; aa) {
writefln("[%s]: [%s]", ch, str);
}
--------------------------------------
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list