Bug 19098 – Improve error for non-assignable struct
Status
RESOLVED
Resolution
FIXED
Severity
trivial
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2018-07-19T11:25:26Z
Last change time
2018-09-06T16:38:23Z
Assigned to
No Owner
Creator
RazvanN
Comments
Comment #0 by razvan.nitu1305 — 2018-07-19T11:25:26Z
struct A
{
const int a;
this(int) {}
}
void main()
{
A a = A(2);
A b = A(3);
a = b;
}
Error: cannot modify struct a A with immutable members
A does not contain any immutable members. Error message should be:
cannot modify struct instance a of type A because it contains non-mutable members
Comment #1 by razvan.nitu1305 — 2018-07-19T11:31:55Z