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

Function relTypesFromDecl

symbols/typeexprs.go:301–310  ·  view source on GitHub ↗

relTypesFromDecl converts bounds a list of RelTypes.

(decl ast.Decl)

Source from the content-addressed store, hash-verified

299
300// relTypesFromDecl converts bounds a list of RelTypes.
301func relTypesFromDecl(decl ast.Decl) ([]ast.BaseTerm, error) {
302 if len(decl.Bounds) == 0 {
303 return nil, fmt.Errorf("no bound decls in %v", decl)
304 }
305 relTypes := make([]ast.BaseTerm, len(decl.Bounds))
306 for i, boundDecl := range decl.Bounds {
307 relTypes[i] = NewRelType(boundDecl.Bounds...)
308 }
309 return relTypes, nil
310}
311
312// RelTypeFromAlternatives converts list of rel types bounds to union of relation types.
313// It is assumed that each alternatives is a RelType.

Callers 1

RelTypeExprFromDeclFunction · 0.85

Calls 1

NewRelTypeFunction · 0.85

Tested by

no test coverage detected