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

Function StructTypeRequiredArgs

symbols/typeexprs.go:186–197  ·  view source on GitHub ↗

StructTypeRequiredArgs returns type arguments of a StructType.

(tpe ast.BaseTerm)

Source from the content-addressed store, hash-verified

184
185// StructTypeRequiredArgs returns type arguments of a StructType.
186func StructTypeRequiredArgs(tpe ast.BaseTerm) ([]ast.BaseTerm, error) {
187 if debug && !IsStructTypeExpression(tpe) {
188 return nil, fmt.Errorf("not a struct type expression: %v", tpe)
189 }
190 var required []ast.BaseTerm
191 for _, arg := range typeArgs(tpe) {
192 if !IsOptional(arg) {
193 required = append(required, arg)
194 }
195 }
196 return required, nil
197}
198
199// StructTypeOptionaArgs returns type arguments of a StructType.
200func StructTypeOptionaArgs(tpe ast.BaseTerm) ([]ast.BaseTerm, error) {

Callers 4

HasTypeMethod · 0.85
WellformedTypeFunction · 0.85
TypeConformsFunction · 0.85
TestAccessFunction · 0.85

Calls 3

IsStructTypeExpressionFunction · 0.85
typeArgsFunction · 0.85
IsOptionalFunction · 0.85

Tested by 1

TestAccessFunction · 0.68