Documentation
¶
Overview ¶
Package subst provides type substitution operations for generics.
These operations replace type parameters with concrete types, used during generic instantiation and Self type resolution.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpandInstantiated ¶
ExpandInstantiated expands generic instantiations to their structural form.
For Instantiated{Generic: Array<T>, TypeArgs: [number]}, returns the Array body with T replaced by number. This enables structural comparison and field/method lookup on instantiated generics.
Does not enforce generic constraints; use subtype checking for that.
func Self ¶
Self replaces Self type references with a concrete type. Does not recurse into Interface types because Self inside an Interface is a separate binding that refers to that Interface's implementor.
func Substitute ¶
Substitute replaces type parameters with concrete types throughout a type.
Used during generic instantiation to replace TypeParam references with the corresponding type arguments. The subs map keys are type parameter names.
Types ¶
This section is empty.