mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 05:00:16 +03:00
27 lines
353 B
D
27 lines
353 B
D
/*
|
|
TEST_OUTPUT:
|
|
---
|
|
fail_compilation/fail19099.d(26): Error: cannot modify struct instance `a` of type `A` because it contains `const` or `immutable` members
|
|
---
|
|
*/
|
|
|
|
struct B
|
|
{
|
|
this(this) {}
|
|
~this() {}
|
|
int a;
|
|
}
|
|
|
|
struct A
|
|
{
|
|
B b;
|
|
immutable int a;
|
|
this(int b) { a = b;}
|
|
}
|
|
|
|
void main()
|
|
{
|
|
A a = A(2);
|
|
A b = A(3);
|
|
a = b;
|
|
}
|