mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 05:00:16 +03:00
40 lines
672 B
D
40 lines
672 B
D
/*
|
|
TEST_OUTPUT:
|
|
---
|
|
fail_compilation/fail4421.d(16): Error: function `fail4421.U1.this(this)` destructors, postblits and invariants are not allowed in union `U1`
|
|
fail_compilation/fail4421.d(17): Error: destructor `fail4421.U1.~this` destructors, postblits and invariants are not allowed in union `U1`
|
|
fail_compilation/fail4421.d(18): Error: function `fail4421.U1.invariant` destructors, postblits and invariants are not allowed in union `U1`
|
|
---
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
union U1
|
|
{
|
|
this(this);
|
|
~this();
|
|
invariant() { }
|
|
}
|
|
|
|
struct S1
|
|
{
|
|
this(this);
|
|
~this();
|
|
invariant() { }
|
|
}
|
|
|
|
union U2
|
|
{
|
|
S1 s1;
|
|
}
|
|
|
|
struct S2
|
|
{
|
|
union
|
|
{
|
|
S1 s1;
|
|
int j;
|
|
}
|
|
}
|