A FreeVar represents a free variable of the function to which it belongs.

FreeVars are used to implement anonymous functions, whose free variables are lexically captured in a closure formed by MakeClosure. The value of such a free var is an Alloc or another FreeVar and is considered a potentially escaping heap address, with pointer type.

FreeVars are also used to implement bound method closures. Such a free var represents the receiver value and may be of any type that has concrete methods.

Pos() returns the position of the value that was captured, which belongs to an enclosing function.

FreeVar is referenced in 11 repositories