Enum TVMFFIDefRegionKind#

Enum Documentation#

enum TVMFFIDefRegionKind#

Kind of def region a structural-equal / structural-hash callback is currently in when visiting a field.

Values:

enumerator kTVMFFIDefRegionKindNone#

Not in a def region.

Free vars reachable through this field are uses; they must already be bound by an enclosing def region or equality / hashing falls back to pointer identity.

enumerator kTVMFFIDefRegionKindRecursive#

In a recursive def region.

When we see a free var for the first time, we define the var, and the sub-fields of the var (e.g. its struct_info / type_annotation / shape) are also still in the def region — any free vars discovered inside those sub-fields are themselves treated as fresh defs at the same site.

One example is function parameter lists: the value var and any shape parameters in its type are co-introduced at the same binding site.

enumerator kTVMFFIDefRegionKindNonRecursive#

In a non-recursive def region.

When we see a free var for the first time, we define the var, but the sub-fields of the var are NOT in the def region — they are treated as use references that must resolve against an outer binding. Free vars found in those sub-fields therefore do not rebind; if they are not already bound, equality fails.

One example is a normal binding whose value type contains shape parameters: the value var is introduced fresh, but its shape parameters reference vars defined in an outer scope.