mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00
19 lines
282 B
D
19 lines
282 B
D
/*
|
|
TEST_OUTPUT:
|
|
---
|
|
fail_compilation/immutable_ctor.d(18): Error: `immutable` copy constructor `immutable_ctor.S1.this` cannot construct a mutable object
|
|
---
|
|
*/
|
|
|
|
struct S1
|
|
{
|
|
this(ref const S1 s) immutable {
|
|
}
|
|
int i;
|
|
}
|
|
|
|
void main()
|
|
{
|
|
const(S1) s1;
|
|
S1 ms1 = s1;
|
|
}
|