mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
15 lines
175 B
V
15 lines
175 B
V
struct MyError {
|
|
code int
|
|
msg string
|
|
}
|
|
|
|
fn foo() int | none | IError {
|
|
return IError(MyError{})
|
|
}
|
|
|
|
fn test_string_optional_none() {
|
|
x := foo()
|
|
println(x)
|
|
assert true
|
|
}
|