mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
20 lines
250 B
V
20 lines
250 B
V
type Abc = bool | int | string
|
|
|
|
fn test_aggregate_is_nodetype() {
|
|
x := Abc('test')
|
|
|
|
match x {
|
|
string, int {
|
|
if x is string {
|
|
println('it is a string')
|
|
assert true
|
|
} else {
|
|
assert false
|
|
}
|
|
}
|
|
else {
|
|
assert false
|
|
}
|
|
}
|
|
}
|