mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00
parent
1244ef260b
commit
d6602a6b0f
2 changed files with 46 additions and 11 deletions
|
@ -106,6 +106,32 @@ void test7()
|
|||
assert(t.x == 10 && t.y == 20);
|
||||
}
|
||||
|
||||
/*************************************************/
|
||||
// https://github.com/dlang/dmd/issues/21203
|
||||
|
||||
struct Y8
|
||||
{
|
||||
int a;
|
||||
this() @disable; // default disabled
|
||||
this(int i) { a = i; }
|
||||
}
|
||||
|
||||
struct S8
|
||||
{
|
||||
Y8 m;
|
||||
|
||||
this(int x)
|
||||
{
|
||||
new(m) Y8(x); // initialise `m`
|
||||
}
|
||||
}
|
||||
|
||||
void test8()
|
||||
{
|
||||
S8 s = S8(3);
|
||||
assert(s.m.a == 3);
|
||||
}
|
||||
|
||||
/*************************************************/
|
||||
|
||||
int main()
|
||||
|
@ -117,6 +143,7 @@ int main()
|
|||
test5();
|
||||
test6();
|
||||
test7();
|
||||
test8();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue