mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-21 15:23:13 +01:00
Initial commit after moving to Tango instead of Phobos. Lots of bugfixes... This build is not suitable for most things.
30 lines
281 B
D
30 lines
281 B
D
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;
|
|
}
|