relTypesFromDecl converts bounds a list of RelTypes.
(decl ast.Decl)
| 299 | |
| 300 | // relTypesFromDecl converts bounds a list of RelTypes. |
| 301 | func 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. |
no test coverage detected