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

17 lines
288 B
V

import x.json2
type MyType = json2.Any
struct Data {
prop MyType
}
fn test_alias_sumtype_method_call() {
a := '{"a":"a","b":1}'
json := json2.raw_decode(a) or { panic(err) }
data := Data{json}
json_str := data.prop.str()
println(json_str)
assert json_str == '{"a":"a","b":1}'
}