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
Comment #2 by github-bugzilla — 2018-09-06T16:38:23Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/2d134353d198046e32ff5f15208cb4b8862d9f82 Fix Issue 19098 - Improve error for non-assignable struct https://github.com/dlang/dmd/commit/794079834985de7ecb2d0b8ca79db2db0c2ab9d9 Merge pull request #8506 from RazvanN7/Improve_error Fix Issue 19098 - Improve error for non-assignable struct merged-on-behalf-of: Jacob Carlborg <[email protected]>