Skip to content

Commit 47c6786

Browse files
committed
fix rego version handling
1 parent 77c4e53 commit 47c6786

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

build.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,18 @@ const (
8282
)
8383

8484
func (v RegoVersion) ToAstRegoVersion() ast.RegoVersion {
85-
return ast.RegoVersionFromInt(int(v))
85+
switch v {
86+
case RegoUndefined:
87+
return ast.RegoUndefined
88+
case RegoV0:
89+
return ast.RegoV0
90+
case RegoV0CompatV1:
91+
return ast.RegoV0CompatV1
92+
case RegoV1:
93+
return ast.RegoV1
94+
default:
95+
return ast.RegoUndefined
96+
}
8697
}
8798

8899
func (v RegoVersion) String() string {

0 commit comments

Comments
 (0)