www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21312] New: [REG 2.095] Newly triggered <expr> is not an


          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 puremagic.com
          Reporter: pro.mathias.lang 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

Oct 14 2020