[Issue 22255] New: JSONValue.opBinaryRight!"in" is const

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Aug 30 10:40:54 UTC 2021


          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 at puremagic.com
          Reporter: giacomo.ratto at 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:


More information about the Digitalmars-d-bugs mailing list