RelTypeAlternatives converts a relation type expression to a list of alternatives relTypes.
(relTypeExpr ast.BaseTerm)
| 331 | |
| 332 | // RelTypeAlternatives converts a relation type expression to a list of alternatives relTypes. |
| 333 | func RelTypeAlternatives(relTypeExpr ast.BaseTerm) []ast.BaseTerm { |
| 334 | if IsUnionTypeExpression(relTypeExpr) { |
| 335 | relTypes, _ := UnionTypeArgs(relTypeExpr) |
| 336 | return relTypes |
| 337 | } |
| 338 | return []ast.BaseTerm{relTypeExpr} |
| 339 | } |
| 340 | |
| 341 | // GetTypeContext returns type context containing all type vars, with /any bound. |
| 342 | func GetTypeContext(typeExpr ast.BaseTerm) map[ast.Variable]ast.BaseTerm { |