MCPcopy
hub / github.com/google/mangle / IsOptional

Function IsOptional

symbols/typeexprs.go:180–183  ·  view source on GitHub ↗

IsOptional returns true if an argument of fn:Struct is an optional field.

(structElem ast.BaseTerm)

Source from the content-addressed store, hash-verified

178
179// IsOptional returns true if an argument of fn:Struct is an optional field.
180func IsOptional(structElem ast.BaseTerm) bool {
181 opt, ok := structElem.(ast.ApplyFn)
182 return ok && opt.Function.Symbol == Optional.Symbol
183}
184
185// StructTypeRequiredArgs returns type arguments of a StructType.
186func StructTypeRequiredArgs(tpe ast.BaseTerm) ([]ast.BaseTerm, error) {

Callers 3

StructTypeRequiredArgsFunction · 0.85
StructTypeOptionaArgsFunction · 0.85
StructTypeFieldFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected