You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With ext.Strings, setting the OptCheckStringFormat option when generating the Program fails if the argument to the format string refers to a field on a message.
=== RUN Test
validator_test.go:59:
Error: Received unexpected error:
error during formatting: string clause can only be used on strings, bools, bytes, ints, doubles, maps, lists, types, durations, and timestamps
--- FAIL: Test (0.00s)
Expected behavior
"1.23"
Additional context
Test passes with either modification:
Remove cel.OptCheckStringFormat
Replace msg type with cel.DynType
The text was updated successfully, but these errors were encountered:
@rodaine I'm not actually able to repro the error. I am curious though whether disabling cel.OptOptimize has any effect as I notice that the tests don't check this case.
Removing just cel.OptOptimize from the above still fails with the same error. I think the above case is passing for you because the variable type is being set to Dyn. If you make it the explicit type of the message, you should see the same error.
Describe the bug
With
ext.Strings
, setting theOptCheckStringFormat
option when generating theProgram
fails if the argument to the format string refers to a field on a message.To Reproduce
Test setup:
Actual behavior
Expected behavior
"1.23"
Additional context
Test passes with either modification:
cel.OptCheckStringFormat
msg
type withcel.DynType
The text was updated successfully, but these errors were encountered: