www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10442] New: RTInfo generation can fail for structs defined in imported modules

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10442

           Summary: RTInfo generation can fail for structs defined in
                    imported modules
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: r.sagitario gmx.de


--- Comment #0 from Rainer Schuetze <r.sagitario gmx.de> 2013-06-22 01:34:11
PDT ---
The current default implementation for template RTInfo always sets the value
0x12345678, so this should work:

////////////////
module s;

struct S
{
    int x;
    void* p;
}

///////////////
module test;

import s;

struct T
{
    int x;
    void* p;
}

void main()
{
    assert(typeid(T).rtInfo == cast(void*)0x12345678); // ok
    assert(typeid(S).rtInfo == cast(void*)0x12345678); // fails
}

////////////////
but the second assertion triggers if compiled with

dmd test.d

If you add s.d to the command line, it does not fail.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 22 2013
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10442



--- Comment #1 from Rainer Schuetze <r.sagitario gmx.de> 2013-06-22 01:39:46
PDT ---
This is not restricted to the typeid expression, but also happens for other
operations like array appending. I suspect it happens if it is only the backend
that is requesting the type info, and then, AggregateDeclaration::semantic3 is
never run.

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