Bug 14399 – std.json cannot parse its own output for nan
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-04-03T02:50:55Z
Last change time
2020-03-21T03:56:42Z
Keywords
pull
Assigned to
No Owner
Creator
ryan
Comments
Comment #0 by ryan — 2015-04-03T02:50:55Z
JSONValue(["val" : float.nan]).toString yeilds `{"val":nan}`.
'nan' is not wrapped in quotes.
However, if you call parseJSON on this string, it fails:
"Found 'a' when expecting 'u'" (I guess its trying to parse 'null').
I would expect std.json to be able to parse the strings it outputs.