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

builtin: add panic_optional_not_set and use it in cgen for fncall()? in main

This commit is contained in:
Delyan Angelov
2021-03-24 13:16:36 +02:00
parent 999b4a47c1
commit f8f74d8587
3 changed files with 6 additions and 1 deletions

View File

@@ -47,6 +47,10 @@ fn panic_debug(line_no int, file string, mod string, fn_name string, s string) {
}
}
pub fn panic_optional_not_set(s string) {
panic('optional not set ($s)')
}
// panic prints a nice error message, then exits the process with exit code of 1.
// It also shows a backtrace on most platforms.
pub fn panic(s string) {