www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22255] New: JSONValue.opBinaryRight!"in" is const


          Issue ID: 22255
           Summary: JSONValue.opBinaryRight!"in" is const
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: trivial
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: giacomo.ratto protonmail.com

The following code fails to compile:

JSONValue j = [ "foo": "bar" ];
if (JSONValue* f = "foo" in j) // Error: cannot convert `const(JSONValue)*` to
        *f = "baz";

making the method inout would solve the problem:

Aug 30 2021