| 1 | @[heap] |
| 2 | struct MyHeapStruct { |
| 3 | name string |
| 4 | } |
| 5 | |
| 6 | // make sure dereferencing of heap structs works in selector expr (in tmpl), |
| 7 | fn test_heap_struct_dereferencing_in_selector_expr() { |
| 8 | a := MyHeapStruct{ |
| 9 | name: 'my_heap_struct_a' |
| 10 | } |
| 11 | b := 2 |
| 12 | out := $tmpl('comptime_call_tmpl_variable_scope_test.tpl') |
| 13 | assert out.trim_space() == 'my_heap_struct_a\n2' |
| 14 | } |
| 15 |