pub enum TypeKind {
Show 13 variants
Simple(SimpleKind),
Compound {
kind: CompoundKind,
args: TypeList,
writable: bool,
},
Nominal {
id: Symbol,
params: TypeList,
writable: bool,
},
ImportNamespace(EcoString),
Function(Arc<FunctionType>),
Var {
id: TypeVarId,
hint: Option<EcoString>,
},
Uninferred,
Parameter(EcoString),
Never,
Tuple(Vec<Type>),
Array {
length: u64,
element: Box<Type>,
},
Error(ErrorReported),
ReceiverPlaceholder,
}Variants§
Simple(SimpleKind)
Compound
Fields
kind: CompoundKindNominal
ImportNamespace(EcoString)
Package namespace handle. Produced by imports (e.g. import http "net/http"
produces an ImportNamespace("go:net/http") on the local identifier).
Dot-access on this type resolves to the package’s exports.
Function(Arc<FunctionType>)
Var
Type variable handle. Binding state lives in a TypeEnv owned by the
checker; the inline hint is display metadata set at allocation time
so Display/Debug work without env access.
Uninferred
Placeholder on syntax that has not entered type inference yet.
Parameter(EcoString)
Never
Tuple(Vec<Type>)
Array
Fixed-size array Array<T, N>, lowered to Go [N]T. The length is part
of the type, so different-length arrays never unify.
Error(ErrorReported)
Poison type returned after an error has been reported. Unifies with everything silently, preventing cascading diagnostics.
ReceiverPlaceholder
Sentinel occupying the receiver slot of an interface method type.
Unifies silently so an implementing type’s receiver does not conflict
with the abstract method shape. Previously encoded as
Constructor { id: "**nominal.__receiver__" }.