digitalmars.D.bugs - [Issue 12663] New: Wrong error message for mutation of immutable
- via Digitalmars-d-bugs (26/26) Apr 27 2014 https://issues.dlang.org/show_bug.cgi?id=12663
https://issues.dlang.org/show_bug.cgi?id=12663 Issue ID: 12663 Summary: Wrong error message for mutation of immutable static array Product: D Version: D2 Hardware: x86 OS: Windows Status: NEW Keywords: diagnostic Severity: normal Priority: P1 Component: DMD Assignee: nobody puremagic.com Reporter: bearophile_hugs eml.cc immutable static int[] data = [1]; static this() { data.length++; } void main() {} DMD 2.066alpha gives an error message that is both wrong in contents and refers to the wrong line: test2.d(1,31): Error: constant 1u is not an lvalue Expected is an error message like: test2.d(3,5): Error: cannot modify immutable expression data --
Apr 27 2014