You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The temporary reference holder variable that stores the returned value of foo() has been eliminated because this returned value has been immediately (?) assigned to p. However, p is of type T, not V, so the b' s reference count is not tracked.
type T = struct {x: int}
type V = struct {a: T; b: []int}
fn foo(): V {
return {{42}, {}}
}
fn main() {
p := foo().a
printf("%v\n", p) // {x: 42}
} // Warning: Memory leak
The text was updated successfully, but these errors were encountered:
The temporary reference holder variable that stores the returned value of
foo()
has been eliminated because this returned value has been immediately (?) assigned top
. However,p
is of typeT
, notV
, so theb
' s reference count is not tracked.The text was updated successfully, but these errors were encountered: