panic: distinguish between builtin and main modules
parent
cdf70c070b
commit
0e241162d9
|
@ -476,7 +476,7 @@ fn (mut g Gen) fn_call(node ast.CallExpr) {
|
||||||
pafn := g.fn_decl.name.after('.')
|
pafn := g.fn_decl.name.after('.')
|
||||||
mut pamod := g.fn_decl.name.all_before_last('.')
|
mut pamod := g.fn_decl.name.all_before_last('.')
|
||||||
if pamod == pafn {
|
if pamod == pafn {
|
||||||
pamod == 'builtin'
|
pamod = if g.fn_decl.is_builtin { 'builtin' } else { 'main' }
|
||||||
}
|
}
|
||||||
g.write('panic_debug($paline, tos3("$pafile"), tos3("$pamod"), tos3("$pafn"), ')
|
g.write('panic_debug($paline, tos3("$pafile"), tos3("$pamod"), tos3("$pafn"), ')
|
||||||
g.call_args(node.args, node.expected_arg_types)
|
g.call_args(node.args, node.expected_arg_types)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
Foo
|
Foo
|
||||||
================ V panic ================
|
================ V panic ================
|
||||||
module: __as_cast
|
module: builtin
|
||||||
function: __as_cast()
|
function: __as_cast()
|
||||||
message: as cast: cannot cast
|
message: as cast: cannot cast
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
================ V panic ================
|
================ V panic ================
|
||||||
module: buggy_function
|
module: main
|
||||||
function: buggy_function()
|
function: buggy_function()
|
||||||
message: panicing...
|
message: panicing...
|
||||||
file: vlib/v/tests/inout/panic_with_cg.v
|
file: vlib/v/tests/inout/panic_with_cg.v
|
||||||
|
|
Loading…
Reference in New Issue