Closed fore5fire closed 6 months ago
According to the spec, maps should support int, uint, and bool keys in addition to strings. The parser already supports this but accessing maps using non-string keys is unimplemented in the interpreter, so I added match cases to support this.
The spec makes it pretty clear that map indexes of ints, uints, and floats are done using the cel's numeric equality (see https://github.com/google/cel-spec/blob/master/doc/langdef.md#equality and https://github.com/google/cel-spec/blob/master/doc/langdef.md#numbers). For statically typed maps this would be rejected by the checker even though its allowed by the runtime, but from what I can tell cel-rust doesn't have a separate check step, so I implemented these to work how spec describes the runtime.
@fore5fire approved but looks like there are conflicts that need to be resolved.
Should be fixed now
According to the spec, maps should support int, uint, and bool keys in addition to strings. The parser already supports this but accessing maps using non-string keys is unimplemented in the interpreter, so I added match cases to support this.
The spec makes it pretty clear that map indexes of ints, uints, and floats are done using the cel's numeric equality (see https://github.com/google/cel-spec/blob/master/doc/langdef.md#equality and https://github.com/google/cel-spec/blob/master/doc/langdef.md#numbers). For statically typed maps this would be rejected by the checker even though its allowed by the runtime, but from what I can tell cel-rust doesn't have a separate check step, so I implemented these to work how spec describes the runtime.