package
0.0.0-20220218190644-4958d6d39439
Repository: https://github.com/jhump/golang-x-tools.git
Documentation: pkg.go.dev
# Packages
No description provided by the author
The genericfeatures package provides utilities for detecting usage of generic programming in Go packages.
# Functions
ForFuncType returns n.TypeParams.
ForNamed extracts the (possibly empty) type parameter object list from named.
ForSignature returns sig.TypeParams().
ForTypeSpec returns n.TypeParams.
GenericAssignableTo is a generalization of types.AssignableTo that implements the following rule for uninstantiated generic types:
If V and T are generic named types, then V is considered assignable to T if, for every possible instantation of V[A_1, ..., A_N], the instantiation T[A_1, ..., A_N] is valid and V[A_1, ..., A_N] implements T[A_1, ..., A_N].
GetInstances returns info.Instances.
InitInstanceInfo initializes info to record information about type and function instances.
Instantiate calls types.Instantiate.
InterfaceTermSet computes the normalized terms for a constraint interface, returning an error if the term set cannot be computed or is empty.
IsComparable calls iface.IsComparable().
IsImplicit calls iface.IsImplicit().
IsMethodSet calls iface.IsMethodSet().
IsTypeParam reports whether t is a type parameter.
MarkImplicit calls iface.MarkImplicit().
NamedTypeArgs returns named.TypeArgs().
NamedTypeOrigin returns named.Orig().
NewContext calls types.NewContext.
NewSignatureType calls types.NewSignatureType.
NewTerm calls types.NewTerm.
NewTypeParam calls types.NewTypeParam.
NewUnion calls types.NewUnion.
OriginMethod returns the origin method associated with the method fn.
PackIndexExpr returns an *ast.IndexExpr or *ast.IndexListExpr, depending on the cardinality of indices.
RecvTypeParams returns sig.RecvTypeParams().
SetForNamed sets the type params tparams on n.
SetTypeParamConstraint calls tparam.SetConstraint(constraint).
StructuralTerms returns a slice of terms representing the normalized structural type restrictions of a type parameter, if any.
UnionTermSet computes the normalized terms for a union, returning an error if the term set cannot be computed or is empty.
UnpackIndexExpr extracts data from AST nodes that represent index expressions.
# Constants
Enabled reports whether type parameters are enabled in the current build environment.
# Variables
No description provided by the author
# Type aliases
Context is an alias for types.Context.
IndexListExpr is an alias for ast.IndexListExpr.
Instance is an alias for types.Instance.
Term is an alias for types.Term.
TypeList is an alias for types.TypeList.
TypeParam is an alias for types.TypeParam.
TypeParamList is an alias for types.TypeParamList.
Union is an alias for types.Union.