[Issue 6168] New: Regression (2.047): Cannot create enum of struct with constructor

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jun 16 16:38:15 PDT 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 at puremagic.com
        ReportedBy: johann.macdonagh at gmail.com


--- Comment #0 from Johann MacDonagh <johann.macdonagh at 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: -------


More information about the Digitalmars-d-bugs mailing list