mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
doc: document if as
This commit is contained in:
parent
6a567a0dd6
commit
00dfce655e
@ -1499,6 +1499,10 @@ if x.bar is MyStruct {
|
||||
// x.bar is automatically casted
|
||||
println(x.bar)
|
||||
}
|
||||
else if x.bar is MyStruct2 as new_var {
|
||||
// you can use `as` to create aliases
|
||||
println(new_var)
|
||||
}
|
||||
match x.bar {
|
||||
MyStruct {
|
||||
// x.bar is automatically casted
|
||||
|
Loading…
Reference in New Issue
Block a user