mirror of
https://github.com/vlang/v.git
synced 2025-09-11 16:36:20 -04:00
parent
a9a96b897e
commit
76ae040f71
10
vlib/v/debug/tests/struct_heap.expect
Normal file
10
vlib/v/debug/tests/struct_heap.expect
Normal file
@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env expect
|
||||
source "common.tcl"
|
||||
|
||||
expect "Break on * main in ${test_file}:8"
|
||||
expect "${test_file}:8 vdbg> "
|
||||
send "p st\n"
|
||||
expect "st = AStruct{\r\n a: 1\r\n} (main.AStruct)"
|
||||
expect "${test_file}:8 vdbg> "
|
||||
send "q\n"
|
||||
expect eof
|
10
vlib/v/debug/tests/struct_heap.vv
Normal file
10
vlib/v/debug/tests/struct_heap.vv
Normal file
@ -0,0 +1,10 @@
|
||||
@[heap]
|
||||
struct AStruct {
|
||||
a int
|
||||
}
|
||||
|
||||
fn main() {
|
||||
st := AStruct{1}
|
||||
$dbg;
|
||||
dump(st)
|
||||
}
|
@ -4527,6 +4527,8 @@ fn (mut g Gen) debugger_stmt(node ast.DebuggerStmt) {
|
||||
'&'
|
||||
} else if !str_method_expects_ptr && obj.typ.is_ptr() {
|
||||
'*'.repeat(obj.typ.nr_muls())
|
||||
} else if !str_method_expects_ptr && obj_sym.is_heap() {
|
||||
'*'
|
||||
} else if obj.is_auto_heap && var_typ.is_ptr() && str_method_expects_ptr {
|
||||
'*'
|
||||
} else if !obj.is_auto_heap && var_typ.is_ptr() && str_method_expects_ptr {
|
||||
|
Loading…
x
Reference in New Issue
Block a user