[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


https://issues.dlang.org/show_bug.cgi?id=22255

          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
`JSONValue*`
        *f = "baz";

making the method inout would solve the problem:
https://github.com/dlang/phobos/pull/8218

--


More information about the Digitalmars-d-bugs mailing list