// isValid reports whether t is a valid type. func isValid(t Type) bool { … } func isBoolean(t Type) bool { … } func isInteger(t Type) bool { … } func isUnsigned(t Type) bool { … } func isFloat(t Type) bool { … } func isComplex(t Type) bool { … } func isNumeric(t Type) bool { … } func isString(t Type) bool { … } func isIntegerOrFloat(t Type) bool { … } func isConstType(t Type) bool { … } // isBasic reports whether under(t) is a basic type with the specified info. // If t is a type parameter the result is false; i.e., // isBasic does not look inside a type parameter. func isBasic(t Type, info BasicInfo) bool { … } func allBoolean(t Type) bool { … } func allInteger(t Type) bool { … } func allUnsigned(t Type) bool { … } func allNumeric(t Type) bool { … } func allString(t Type) bool { … } func allOrdered(t Type) bool { … } func allNumericOrString(t Type) bool { … } // allBasic reports whether under(t) is a basic type with the specified info. // If t is a type parameter, the result is true if isBasic(t, info) is true // for all specific types of the type parameter's type set. // allBasic(t, info) is an optimized version of isBasic(coreType(t), info). func allBasic(t Type, info BasicInfo) bool { … } // hasName reports whether t has a name. This includes // predeclared types, defined types, and type parameters. // hasName may be called with types that are not fully set up. func hasName(t Type) bool { … } // isTypeLit reports whether t is a type literal. // This includes all non-defined types, but also basic types. // isTypeLit may be called with types that are not fully set up. func isTypeLit(t Type) bool { … } // isTyped reports whether t is typed; i.e., not an untyped // constant or boolean. // Safe to call from types that are not fully set up. func isTyped(t Type) bool { … } // isUntyped(t) is the same as !isTyped(t). // Safe to call from types that are not fully set up. func isUntyped(t Type) bool { … } // isUntypedNumeric reports whether t is an untyped numeric type. // Safe to call from types that are not fully set up. func isUntypedNumeric(t Type) bool { … } // IsInterface reports whether t is an interface type. func IsInterface(t Type) bool { … } // isNonTypeParamInterface reports whether t is an interface type but not a type parameter. func isNonTypeParamInterface(t Type) bool { … } // isTypeParam reports whether t is a type parameter. func isTypeParam(t Type) bool { … } // hasEmptyTypeset reports whether t is a type parameter with an empty type set. // The function does not force the computation of the type set and so is safe to // use anywhere, but it may report a false negative if the type set has not been // computed yet. func hasEmptyTypeset(t Type) bool { … } // isGeneric reports whether a type is a generic, uninstantiated type // (generic signatures are not included). // TODO(gri) should we include signatures or assert that they are not present? func isGeneric(t Type) bool { … } // Comparable reports whether values of type T are comparable. func Comparable(T Type) bool { … } // If dynamic is set, non-type parameter interfaces are always comparable. // If reportf != nil, it may be used to report why T is not comparable. func comparableType(T Type, dynamic bool, seen map[Type]bool, reportf func(string, ...interface{ … } // hasNil reports whether type t includes the nil value. func hasNil(t Type) bool { … } // samePkg reports whether packages a and b are the same. func samePkg(a, b *Package) bool { … } type ifacePair … func (p *ifacePair) identical(q *ifacePair) bool { … } type comparer … // For changes to this code the corresponding changes should be made to unifier.nify. func (c *comparer) identical(x, y Type, p *ifacePair) bool { … } // identicalOrigin reports whether x and y originated in the same declaration. func identicalOrigin(x, y *Named) bool { … } // identicalInstance reports if two type instantiations are identical. // Instantiations are identical if their origin and type arguments are // identical. func identicalInstance(xorig Type, xargs []Type, yorig Type, yargs []Type) bool { … } // Default returns the default "typed" type for an "untyped" type; // it returns the incoming type for all other types. The default type // for untyped nil is untyped nil. func Default(t Type) Type { … } // maxType returns the "largest" type that encompasses both x and y. // If x and y are different untyped numeric types, the result is the type of x or y // that appears later in this list: integer, rune, floating-point, complex. // Otherwise, if x != y, the result is nil. func maxType(x, y Type) Type { … } // clone makes a "flat copy" of *p and returns a pointer to the copy. func clone[P *T, T any](p P) P { … } // isValidName reports whether s is a valid Go identifier. func isValidName(s string) bool { … }