google / cel-go

Fast, portable, non-Turing complete expression evaluation with gradual typing (Go)
https://cel.dev
Apache License 2.0
2.19k stars 218 forks source link

Fix issue related to native byte arrays in type system #956

Closed patrickpichler closed 3 months ago

patrickpichler commented 3 months ago

Byte arrays are now always considered bytes by both the type checker and the runtime. This fixes a bug, when there was a native struct containing an byte array and a function that takes the byte arrays as input, the program would fail at runtime, as it would expect a dynamic list instead of bytes.

For an concrete example see the TestFunctionOverloadForNative test in the native tests.

Fixes #953

TristonianJones commented 3 months ago

/gcbrun

patrickpichler commented 3 months ago

@TristonianJones I see that a test was failing in CI, but I cannot reproduce it at all locally. Do you have any idea why that could happen? I also used go version 1.20 to run the tests.