diff --git a/vlib/v/parser/fn.v b/vlib/v/parser/fn.v index 294f94df47..e2fa7e7fbd 100644 --- a/vlib/v/parser/fn.v +++ b/vlib/v/parser/fn.v @@ -257,6 +257,7 @@ fn (mut p Parser) fn_decl() ast.FnDecl { no_body: no_body pos: start_pos.extend(end_pos) body_pos: body_start_pos + file: p.file_name is_builtin: p.builtin_mod || p.mod in util.builtin_module_parts ctdefine: ctdefine } diff --git a/vlib/v/tests/inout/panic_with_cg.out b/vlib/v/tests/inout/panic_with_cg.out new file mode 100644 index 0000000000..05bfa60ed4 --- /dev/null +++ b/vlib/v/tests/inout/panic_with_cg.out @@ -0,0 +1,6 @@ +================ V panic ================ + module: buggy_function + function: buggy_function() + message: panicing... + file: vlib/v/tests/inout/panic_with_cg.v + line: 3 diff --git a/vlib/v/tests/inout/panic_with_cg.vv b/vlib/v/tests/inout/panic_with_cg.vv new file mode 100644 index 0000000000..7e2fb4f913 --- /dev/null +++ b/vlib/v/tests/inout/panic_with_cg.vv @@ -0,0 +1,8 @@ + +fn buggy_function() { + panic('panicing...') +} + +fn main(){ + buggy_function() +}