mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 21:21:48 +03:00
34 lines
669 B
D
34 lines
669 B
D
// https://issues.dlang.org/show_bug.cgi?id=21547
|
|
|
|
/*
|
|
TEST_OUTPUT:
|
|
---
|
|
fail_compilation/fail21547.d(32): Error: struct `Bar` has constructors, cannot use `{ initializers }`, use `Bar( initializers )` instead
|
|
fail_compilation/fail21547.d(33): Error: struct `Bar1` has constructors, cannot use `{ initializers }`, use `Bar1( initializers )` instead
|
|
---
|
|
*/
|
|
|
|
struct Bar
|
|
{
|
|
@disable this(int a) {}
|
|
this(int a, int b) {}
|
|
|
|
string a;
|
|
uint b;
|
|
}
|
|
|
|
struct Bar1
|
|
{
|
|
@disable this(int a) {}
|
|
this(const ref Bar1 o) {}
|
|
this(int a, int b) {}
|
|
|
|
string a;
|
|
uint b;
|
|
}
|
|
|
|
void main ()
|
|
{
|
|
Bar b = { a: "Hello", b: 42 };
|
|
Bar1 b1 = { a: "Hello", b: 42 };
|
|
}
|