v icon indicating copy to clipboard operation
v copied to clipboard

JSON encode/decode example in playground

Open defond0 opened this issue 7 years ago • 2 comments

Running the JSON encoding/decoding example in the playground yields

You just found a bug. V can't compile this program, but it should. Please create a GitHub issue.

json_encoding_decoding

defond0 avatar Jun 21 '19 16:06 defond0

A smaller example of the bug:

import json
struct Test {
    s string
}
user := json.decode(Test, '{"s": "Frodo"}') or { return }
println(user.s)

Output:

`` needs to return ``

Undumendil avatar Jun 21 '19 17:06 Undumendil

Since the playground has been closed and the imports have been fixed, I will close this issue.

Bowero avatar Jun 25 '19 14:06 Bowero