view tests/mini/structinit3.d @ 838:94ba810ea2b0

Fixed problem with nested function inside static nested function. see mini/compile_nested2.d. fixes #143 .
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Tue, 09 Dec 2008 14:57:01 +0100
parents 794c8af186ce
children
line wrap: on
line source

struct S {
    int a; int b; int c; int d = 7;
}
void test(int i) {
    S s = { 1, i };   // q.a = 1, q.b = i, q.c = 0, q.d = 7
    assert(s.a == 1);
    assert(s.b == i);
    assert(s.c == 0); // line 8
    assert(s.d == 7);
}
void main() {
    test(42);
}