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
I parse a string of JSON using the Json package. Printing the JsonDoc shows correct data. Passing that same JsonDoc to a behaviour then printing it shows corrupt data. Changing the behaviour to a function makes the data print correctly again.
The following is test code that demonstrates the issue:
use "json"
actor Main
let test: String = "{\"result\":{\"version\":110200,\"protocolversion\":70002,\"walletversion\":60000,\"balance\":0.00000000,\"blocks\":410357,\"timeoffset\":-1,\"connections\":8,\"proxy\":\"\",\"difficulty\":178659257772.52728271,\"testnet\":false,\"keypoololdest\":1439278680,\"keypoolsize\":101,\"paytxfee\":0.00000000,\"relayfee\":0.00005000,\"errors\":\"\"},\"error\":null,\"id\":\"0\"}"
new create(env:Env) =>
try
let json = recover iso JsonDoc end
json.parse(test)
env.out.print(json.string())
foo(env, consume json)
end
be foo(env:Env, json: JsonDoc iso) =>
env.out.print("foo: " + json.string())
The first print of the json string in the constructor displays:
I parse a string of JSON using the Json package. Printing the JsonDoc shows correct data. Passing that same JsonDoc to a behaviour then printing it shows corrupt data. Changing the behaviour to a function makes the data print correctly again.
The following is test code that demonstrates the issue:
The first print of the json string in the constructor displays:
The second print in the foo behaviour displays:
If the foo behaviour is changed to a function then it displays correctly.
The text was updated successfully, but these errors were encountered: