mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
12 lines
144 B
V
12 lines
144 B
V
struct Moon {}
|
|
|
|
struct Mars {}
|
|
|
|
type World = Mars | Moon
|
|
|
|
fn test_assert_sumtype() {
|
|
w := World(Moon{})
|
|
assert w is Moon
|
|
assert w !is Mars
|
|
}
|