mirror of
https://github.com/vlang/v.git
synced 2025-09-16 16:02:29 +03:00
markused: skip panic_result_not_set (generated for fn main(){ foo()! }
) too
This commit is contained in:
parent
095f4bcf86
commit
4588bb44ab
4 changed files with 19 additions and 0 deletions
|
@ -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_debug'
|
||||||
}
|
}
|
||||||
all_fn_root_names << 'panic_optional_not_set'
|
all_fn_root_names << 'panic_optional_not_set'
|
||||||
|
all_fn_root_names << 'panic_result_not_set'
|
||||||
if pref.is_test {
|
if pref.is_test {
|
||||||
all_fn_root_names << 'main.cb_assertion_ok'
|
all_fn_root_names << 'main.cb_assertion_ok'
|
||||||
all_fn_root_names << 'main.cb_assertion_failed'
|
all_fn_root_names << 'main.cb_assertion_failed'
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
42
|
||||||
|
42
|
|
@ -0,0 +1,2 @@
|
||||||
|
42
|
||||||
|
42
|
|
@ -0,0 +1,14 @@
|
||||||
|
fn opt() ?int {
|
||||||
|
return 42
|
||||||
|
}
|
||||||
|
|
||||||
|
fn result() !int {
|
||||||
|
return 42
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
o := opt()?
|
||||||
|
r := result()!
|
||||||
|
println(o)
|
||||||
|
println(r)
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue