MCPcopy Create free account
hub / github.com/despiteallobjections/amigo / underIs

Function underIs

types/expr.go:159–164  ·  view source on GitHub ↗

If typ is a type parameter, underIs returns the result of typ.underIs(f). Otherwise, underIs returns the result of f(under(typ)).

(typ Type, f func(Type) bool)

Source from the content-addressed store, hash-verified

157// If typ is a type parameter, underIs returns the result of typ.underIs(f).
158// Otherwise, underIs returns the result of f(under(typ)).
159func underIs(typ Type, f func(Type) bool) bool {
160 if tpar, _ := typ.(*TypeParam); tpar != nil {
161 return tpar.underIs(f)
162 }
163 return f(under(typ))
164}
165
166func (check *Checker) unary(x *operand, e *Operation) {
167 check.expr(x, e.X)

Callers 3

funcTypeMethod · 0.85
builtinMethod · 0.85
exprInternalMethod · 0.85

Calls 3

underFunction · 0.85
fFunction · 0.50
underIsMethod · 0.45

Tested by

no test coverage detected