From 47c6786fad21d84e66a8c226c6f2e30cea5f8caf Mon Sep 17 00:00:00 2001 From: Gert Drapers <1533850+gertd@users.noreply.github.com> Date: Wed, 20 May 2026 11:48:26 +0200 Subject: [PATCH] fix rego version handling --- build.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/build.go b/build.go index 398d21e..7264862 100644 --- a/build.go +++ b/build.go @@ -82,7 +82,18 @@ const ( ) func (v RegoVersion) ToAstRegoVersion() ast.RegoVersion { - return ast.RegoVersionFromInt(int(v)) + switch v { + case RegoUndefined: + return ast.RegoUndefined + case RegoV0: + return ast.RegoV0 + case RegoV0CompatV1: + return ast.RegoV0CompatV1 + case RegoV1: + return ast.RegoV1 + default: + return ast.RegoUndefined + } } func (v RegoVersion) String() string {