mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
14 lines
187 B
V
14 lines
187 B
V
![]() |
import json
|
||
|
|
||
|
struct Test {
|
||
|
optional_sumtype ?MySumtype
|
||
|
}
|
||
|
|
||
|
type MySumtype = int | string
|
||
|
|
||
|
fn test_simple() {
|
||
|
test := Test{}
|
||
|
encoded := json.encode(test)
|
||
|
assert dump(encoded) == '{}'
|
||
|
}
|