www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19297] New: JSONValue of signed and unsigned equal values is


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


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*.

Oct 10 2018