Numbers bigger than `1L << 53` loose lower bits when parsing by default parser using Scala.js · Issue #2311 · circe/circe · GitHub
More Web Proxy on the site http://driver.im/
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//>usingdep"io.circe::circe-core::0.14.10"//>usingdep"io.circe::circe-parser::0.14.10"////> using dep "io.circe::circe-jawn::0.14.10"importio.circe.Jsonimportio.circe.parser._//import io.circe.jawn._
println(parse("[9007199254740993,9999999999999999999]").getOrElse(null))
Store it to script.js and use the following command to build with latest scala-cli:
this is apparently using pure javascript JSON.parse, then converting after, so I guess standard javascript semantics should be expected.
Then why println(Json.arr(Json.fromBigInt(BigInt("9223372036854775808")),Json.fromBigInt(BigInt("9999999999999999999"))).noSpaces) produces [9223372036854775808,9999999999999999999] without wrapping numbers by quotation marks?
Is it expected that the library cannot parse own output without loosing information when used with Scala.js?
Script to reproduce:
Store it to
script.js
and use the following command to build with latestscala-cli
:Result of running with
node
:Expected output:
Works fine with
circe-jawn
instead ofcirce-parser
, or using JVMs or Scala Native.The text was updated successfully, but these errors were encountered: