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:
13
vlib/json/json_decode_with_sumtype_test.v
Normal file
13
vlib/json/json_decode_with_sumtype_test.v
Normal 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'])"
|
||||
}
|
||||
Reference in New Issue
Block a user