remap-lang: improve arithmetic type checking and test coverage #5246
Labels
domain: reliability
Anything related to Vector's reliability
domain: vrl
Anything related to the Vector Remap Language
type: enhancement
A value-adding code change that enhances its existing functionality.
Milestone
In #5059 we've improved type checking of arithmetic operations to be more exact than before. However, as @FungusHumungus notes in #5059 (comment), there is still more we can do to get more precise type information.
For example,
"foo" * 3
is valid, and will always return"foofoofoo"
, but the type definition of this expression resolves toBytes | Integer | Float
, which isn't wrong, but also isn't as accurate as it can be (e.g.Bytes
).Additionally, we need to expand our test coverage of the arithmetic expression logic, as there are still some gaps in its functionality.
For example, while
"foo" * 3
works,3 * "foo"
does not.The text was updated successfully, but these errors were encountered: