Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
felipensp committed Sep 24, 2024
1 parent 7c7664e commit cac919d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion vlib/v/checker/checker.v
Original file line number Diff line number Diff line change
Expand Up @@ -4375,7 +4375,14 @@ fn (mut c Checker) mark_as_referenced(mut node ast.Expr, as_interface bool) {
node.obj.is_auto_heap = true
}
}
.sum_type, .interface_, .function {}
.sum_type, .interface_ {}
.function {
if type_sym.info is ast.FnType {
if type_sym.info.is_anon {
node.obj.is_auto_heap = true
}
}
}
else {
node.obj.is_auto_heap = true
}
Expand Down

0 comments on commit cac919d

Please sign in to comment.