[Issue 21312] New: [REG 2.095] Newly triggered <expr> is not an lvalue and cannot be modified
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Oct 15 06:57:59 UTC 2020
https://issues.dlang.org/show_bug.cgi?id=21312
Issue ID: 21312
Summary: [REG 2.095] Newly triggered <expr> is not an lvalue
and cannot be modified
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: industry, rejects-valid
Severity: regression
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: pro.mathias.lang at gmail.com
Test code:
```
public T deserializeFull (T) () @safe
{
static if (is(T : E*, E))
{
return &[ deserializeFull!(typeof(T.init[0]))() ][0];
}
return T.init;
}
struct Block { string value; }
void main ()
{
auto b = deserializeFull!(immutable(Block)*)();
}
```
Works in v2.094.0, but with master, breaks with:
```
foo.d(5): Error: [deserializeFull()][0] is not an lvalue and cannot be modified
foo.d(14): Error: template instance foo.deserializeFull!(immutable(Block)*)
error instantiating
```
Introduced by https://github.com/dlang/dmd/pull/10124
--
More information about the Digitalmars-d-bugs
mailing list