Bug 10160 – No line number "cannot modify struct ... with immutable members"
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-05-24T01:07:00Z
Last change time
2013-05-24T12:55:48Z
Keywords
diagnostic, pull, rejects-valid
Assigned to
nobody
Creator
k.hara.pg
Comments
Comment #0 by k.hara.pg — 2013-05-24T01:07:53Z
This code prints strange no line number error.
struct S
{
this(this) {}
}
struct X
{
const int x;
S s;
}
void main()
{
X x;
}
output:
Error: cannot modify struct this X with immutable members
Comment #1 by k.hara.pg — 2013-05-24T01:09:30Z
This little modified code works with 2.062, but causes same no line number error with git head.
struct S
{
this(this) {}
}
struct X
{
const int x = 1; // add initializer
S s;
}
void main()
{
X x;
}