Thread overview
[Issue 6168] New: Regression (2.047): Cannot create enum of struct with constructor
Jun 16, 2011
Johann MacDonagh
Jun 17, 2011
kennytm@gmail.com
Jun 17, 2011
kennytm@gmail.com
Jun 17, 2011
Johann MacDonagh
June 16, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6168

           Summary: Regression (2.047): Cannot create enum of struct with
                    constructor
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: johann.macdonagh@gmail.com


--- Comment #0 from Johann MacDonagh <johann.macdonagh@gmail.com> 2011-06-16 16:33:33 PDT ---
struct Test
{
    this(int a)
    {
    }
}

void main()
{
    enum a = Test(5);
}

This compiled on 2.046 but no longer does. The error messages have changed over the versions, but current 2.053 complains:

test.d(10): Error: variable __ctmp3 cannot be read at compile time
test.d(10): Error: cannot evaluate __ctmp3.this(5) at compile time

enum a = Test();

This works fine.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 17, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6168


kennytm@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |kennytm@gmail.com
         Resolution|                            |FIXED


--- Comment #1 from kennytm@gmail.com 2011-06-17 00:17:00 PDT ---
Apparently fixed on git master (2.054) already before you file the bug :)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 17, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6168


kennytm@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|FIXED                       |DUPLICATE


--- Comment #2 from kennytm@gmail.com 2011-06-17 00:29:38 PDT ---
*** This issue has been marked as a duplicate of issue 5954 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 17, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6168



--- Comment #3 from Johann MacDonagh <johann.macdonagh@gmail.com> 2011-06-17 06:59:51 PDT ---
D'oh! I searched for a duplicate before posting, so I don't know how I missed that. Perfect!

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