Bug 19297 – JSONValue of signed and unsigned equal values is not equal
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2018-10-10T13:12:15Z
Last change time
2018-10-27T00:38:28Z
Assigned to
No Owner
Creator
FeepingCreature
Comments
Comment #0 by default_357-line — 2018-10-10T13:12:15Z
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*.
Comment #1 by github-bugzilla — 2018-10-27T00:38:28Z