mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
panic: distinguish between builtin and main modules
This commit is contained in:
parent
cdf70c070b
commit
0e241162d9
@ -476,7 +476,7 @@ fn (mut g Gen) fn_call(node ast.CallExpr) {
|
||||
pafn := g.fn_decl.name.after('.')
|
||||
mut pamod := g.fn_decl.name.all_before_last('.')
|
||||
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.call_args(node.args, node.expected_arg_types)
|
||||
|
@ -1,5 +1,5 @@
|
||||
Foo
|
||||
================ V panic ================
|
||||
module: __as_cast
|
||||
module: builtin
|
||||
function: __as_cast()
|
||||
message: as cast: cannot cast
|
||||
|
@ -1,5 +1,5 @@
|
||||
================ V panic ================
|
||||
module: buggy_function
|
||||
module: main
|
||||
function: buggy_function()
|
||||
message: panicing...
|
||||
file: vlib/v/tests/inout/panic_with_cg.v
|
||||
|
Loading…
Reference in New Issue
Block a user