1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

json: fix error for json decode with sumtype (#14025)

This commit is contained in:
yuyi
2022-04-13 23:06:28 +08:00
committed by GitHub
parent e5809363de
commit dc08105022
2 changed files with 24 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
import json
type Test = []string | string
struct Some {
t Test
}
fn test_json_decode_with_sumtype() ? {
v := json.decode(Some, '{"t": ["string", "string2"]}') ?
println(v)
assert '$v.t' == "Test(['string', 'string2'])"
}