diff --git a/internal/check/engine.go b/internal/check/engine.go index ed3fbabcf..facbfd534 100644 --- a/internal/check/engine.go +++ b/internal/check/engine.go @@ -255,6 +255,11 @@ func (e *Engine) checkUsersetRewrite( Tuple: *r, Type: expand.ComputedUserset, }, e.checkComputedUserset(ctx, r, c, restDepth))) + case *ast.UsersetRewrite: + checks = append(checks, checkgroup.WithEdge(checkgroup.Edge{ + Tuple: *r, + Type: toExpandNodeType(c.Operation), + }, e.checkUsersetRewrite(ctx, r, c, restDepth))) } } @@ -263,6 +268,19 @@ func (e *Engine) checkUsersetRewrite( } } +func toExpandNodeType(op ast.SetOperation) expand.NodeType { + switch op { + case ast.SetOperationUnion: + return expand.Union + case ast.SetOperationDifference: + return expand.Exclusion + case ast.SetOperationIntersection: + return expand.Intersection + default: + return expand.Union + } +} + func (e *Engine) checkComputedUserset( ctx context.Context, r *RelationTuple,