Documentation ¶
Overview ¶
Package typecheck contains a number of typechecking and inference utilities for bigslice operators.
Index ¶
- Variables
- func CanApply(fn slicefunc.Func, arg slicetype.Type) bool
- func Devectorize(typ slicetype.Type) (slicetype.Type, bool)
- func Equal(expect, actual slicetype.Type) bool
- func Location(file string, line int)
- func Panic(calldepth int, message string)
- func Panicf(calldepth int, format string, args ...interface{})
- func Slices(columns ...interface{}) (slicetype.Type, bool)
- type Error
Constants ¶
This section is empty.
Variables ¶
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.
Functions ¶
func Devectorize ¶
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.
func Location ¶
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)
Types ¶
type Error ¶
Error represents a typechecking error. It wraps an underlying error with a location, as captured by NewError.