view tangotests/b.d @ 163:a8cd9bc1021a trunk

[svn r179] lots and lots of fixes, much more of tango now compiles/works.
author lindquist
date Mon, 05 May 2008 07:36:29 +0200
parents 1700239cab2e
children 68a7dd38c03c
line wrap: on
line source

class C
{
    int a;
    union
    {
        int i;
        double d;
    }
    int z;
}

void func()
{
    scope c = new C;
    access1(c);
    assert(c.i == 42);
    access2(c);
    assert(c.d == 2.5);
}

void access1(C c)
{
    c.i = 42;
}

void access2(C c)
{
    c.d = 2.5;
}