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

Function MapTypeArgs

symbols/typeexprs.go:171–177  ·  view source on GitHub ↗

MapTypeArgs returns the type arguments of a MapType.

(tpe ast.BaseTerm)

Source from the content-addressed store, hash-verified

169
170// MapTypeArgs returns the type arguments of a MapType.
171func MapTypeArgs(tpe ast.BaseTerm) (ast.BaseTerm, ast.BaseTerm, error) {
172 if debug && !IsMapTypeExpression(tpe) {
173 return nil, nil, fmt.Errorf("not a map type expression: %v", tpe)
174 }
175 args := typeArgs(tpe)
176 return args[0], args[1], nil
177}
178
179// IsOptional returns true if an argument of fn:Struct is an optional field.
180func IsOptional(structElem ast.BaseTerm) bool {

Callers 2

feasibleAlternativesMethod · 0.92
TestAccessFunction · 0.85

Calls 2

IsMapTypeExpressionFunction · 0.85
typeArgsFunction · 0.85

Tested by 1

TestAccessFunction · 0.68