[Issue 19297] New: JSONValue of signed and unsigned equal values is not equal

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Oct 10 13:12:15 UTC 2018


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

          Issue ID: 19297
           Summary: JSONValue of signed and unsigned equal values is not
                    equal
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: default_357-line at yahoo.de

Repro:

assert(JSONValue([].length) == JSONValue(0));

JSONValue treats them as two different types because one is signed and one is
unsigned. Which is of course nonsense and against spec. JSON doesn't even have
unsigned types; strictly speaking you're supposed to just use doubles for ints,
like JS does. But if there have to be integers in JSONValue, they should work
with doubles, and they *certainly* should work with *themselves*.

--


More information about the Digitalmars-d-bugs mailing list