view test/structs4.d @ 121:9c79b61fb638 trunk

[svn r125] Renamed/moved a few backend member inside DMD structures for consistency. Unit tests are now implemented.
author lindquist
date Tue, 27 Nov 2007 03:09:36 +0100
parents b706170e24a9
children
line wrap: on
line source

module structs4;

struct S{
    int a;
    T t;
}

struct T{
    int b;
    U u;
}

struct U{
    int c;
}

void main()
{
    S s;
    s.a = 3;
    s.t = T.init;
    s.t.b = 4;
    s.t.u = U.init;
    s.t.u.c = 5;
    //{assert(s.t.u.c == 5);}
}