Package typecheck contains a number of typechecking and inference utilities for bigslice operators.
var TestCalldepth = 0
TestCalldepth may be overridden by a user to add call depths to errors that are constructed by NewError. This is useful for testing that error messages capture the correct locations.
Devectorize returns a devectorized version of the provided slicetype: Each of the type's columns is expected to be a slice; the returned type unwraps the slice from each column. If the provided type is not a valid vectorized slice type, false is returned.
Equal tells whether the the expected and actual slicetypes are equal.
Func deconstructs a function's argument and return types into slicetypes. If x is not a function, Func returns false.
If the type of the first argument to the provided function is context.Context, then it is ignored: the returned type contains only the remainder of the arguments.
Location rewrites typecheck errors to use the provided location instead of the one computed by Panic. This allows a caller to attribute typechecking errors where appropriate. Location should only be used as a defer function, as it recovers (and rewrites) panics.
file, line := ... defer Location(file, line)
Panic constructs a typechecking error and then panics with it.
Panicf constructs a new formatted typechecking error and then panics with it.
Slices returns a slicetype of the provided column values. If the passed values are not valid column values, Slices returns false.
Error represents a typechecking error. It wraps an underlying error with a location, as captured by NewError.
Errorf constructs an error in the manner of fmt.Errorf.
NewError creates a new typechecking error at the given calldepth. The returned Error wraps err with the caller's location.
Error implements error.