Gitly
English
Русский
Español
日本語
中文
Português
Log in
Register
v2
/
vlib
/
v
/
tests
/
consts
/
const_can_use_options_results_test.v
20
lines
·
16
sloc
·
239 bytes
·
6488041a749df9762348d019c4223908c476f2e2
Raw
1
const
aaa = iopt()?
2
const
bbb = sopt()!
3
4
fn
iopt() ?int {
5
return
1234
6
}
7
8
fn
sopt() !string {
9
return
'xyz'
10
}
11
12
fn
test_iconsts_are_resolved() {
13
z := aaa
14
assert z == 1234
15
}
16
17
fn
test_sconsts_are_resolved() {
18
z := bbb
19
assert z ==
'xyz'
20
}
21