[Issue 1565] New: ctfe compile-time function fails when the type of a struct member is a struct with multiple members

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Oct 9 21:52:02 PDT 2007


http://d.puremagic.com/issues/show_bug.cgi?id=1565

           Summary: ctfe compile-time function fails when the type of a
                    struct member is a struct with multiple members
           Product: D
           Version: 1.022
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: gamerChad at gmail.com


Here's the example:

struct B
{
  int z = 5;
  int w = 4; // remove this line and it compiles fine.
}

struct A
{
  B y;
}

int crash()
{
  A x;
  return x.y.z;
}

const foo = crash();

void main() {};

When compiled, this yields the following error:
main.d(18): Error: cannot evaluate crash() at compile time

This happened with DMD 1.022 and 1.021, on Windows XP, with both Phobos and
Tango.


-- 



More information about the Digitalmars-d-bugs mailing list