[Issue 9485] New: associative array inside struct: intermodule visibility problem

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Feb 8 08:18:16 PST 2013


http://d.puremagic.com/issues/show_bug.cgi?id=9485

           Summary: associative array inside struct: intermodule
                    visibility problem
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: atankeev at gmail.com


--- Comment #0 from Alexander Tankeev <atankeev at gmail.com> 2013-02-08 08:18:13 PST ---
--[ testcase.d ]--
import std.stdio;
import somelib;

void main()
{
    foo t;
    t.bar[10] = "bar";
    writeln(t);
}
-- [ EOF ]--

--[ somelib.d ]
module somelib;

struct foo
{
    string[int] bar;
}
--[ EOF ]--

$ dmd -c somelib.d
$ dmd -c testcase.d
$ dmd testcase.o somelib.o
testcase.o: In function
`_D3std6format61__T11formatValueTS3std5stdio4File17LockingTextWriterTHiAyaTaZ11formatValueFS3std5stdio4File17LockingTextWriterHiAyaKS3std6format18__T10FormatSpecTaZ10FormatSpecZv':
testcase.d:(.text._D3std6format61__T11formatValueTS3std5stdio4File17LockingTextWriterTHiAyaTaZ11formatValueFS3std5stdio4File17LockingTextWriterHiAyaKS3std6format18__T10FormatSpecTaZ10FormatSpecZv+0x98):
undefined reference to
`_D6object28__T16AssociativeArrayTiTAyaZ16AssociativeArray6lengthMFNdZm'
collect2: error: ld returned 1 exit status
--- errorlevel 1

In LDC it works fine.

-- 
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