www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7860] New: Constant fields of forward referenced structs break everything

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

           Summary: Constant fields of forward referenced structs break
                    everything
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: siegelords_abode yahoo.com



This code used to compile fine with DMD 2.058 but is broken in the git version
of DMD:

struct A(T)
{
    enum A!(T) test = A!(T)();

    static if(true)
    {
        pragma(msg, "Not printed..."); // Not printed
        enum A!(T) blah = A!(T)();
    }
}

void main()
{
    auto a = A!(char).blah; // Error: no property 'blah' for type 'A!(char)'
}

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


Jordi Sayol <g.sayol yahoo.es> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |g.sayol yahoo.es
   Target Milestone|---                         |2.059



Regression confirmed on Linux 32-bit and 64-bit

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


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

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



The root cause is same as bug 7859, and it is already fixed.
Then, the sample code compiles as expected in git head (d16cfe504).

*** This issue has been marked as a duplicate of issue 7859 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 08 2012