1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

markused: skip panic_result_not_set (generated for fn main(){ foo()! }) too

This commit is contained in:
Delyan Angelov 2022-08-06 10:24:17 +03:00
parent 095f4bcf86
commit 4588bb44ab
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
4 changed files with 19 additions and 0 deletions

View File

@ -244,6 +244,7 @@ pub fn mark_used(mut table ast.Table, pref &pref.Preferences, ast_files []&ast.F
all_fn_root_names << 'panic_debug'
}
all_fn_root_names << 'panic_optional_not_set'
all_fn_root_names << 'panic_result_not_set'
if pref.is_test {
all_fn_root_names << 'main.cb_assertion_ok'
all_fn_root_names << 'main.cb_assertion_failed'

View File

@ -0,0 +1,14 @@
fn opt() ?int {
return 42
}
fn result() !int {
return 42
}
fn main() {
o := opt()?
r := result()!
println(o)
println(r)
}