www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9485] New: associative array inside struct: intermodule visibility problem

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: atankeev gmail.com


--- Comment #0 from Alexander Tankeev <atankeev 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: -------
Feb 08 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9485


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich gmail.com


--- Comment #1 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2013-02-08
08:19:50 PST ---
Confirmed on win32, only happens with separate compilation.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 08 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9485



--- Comment #2 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2013-02-08
17:28:40 PST ---
Very similar to Issue 6744. Both are linker errors about a missing "length"
symbol in the associative array.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 08 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9485


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE


--- Comment #3 from Kenji Hara <k.hara.pg gmail.com> 2013-02-17 04:57:09 PST ---
*** This issue has been marked as a duplicate of issue 8997 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 17 2013