The following compiles cleanly:
define Bad: @2025-01-01T00:00:00 + 30
At runtime it throws InvalidPrecision: 1. There is no CQL semantics for adding a bare integer to a DateTime (the author almost certainly meant + 30 days). The compiler should reject the expression as a type error at translation time rather than deferring to runtime.
Expected: compile-time error along the lines of "Could not resolve call to operator Add with signature (System.DateTime, System.Integer)".
Actual: compiles, then throws InvalidPrecision: 1 at runtime.
The following compiles cleanly:
define Bad: @2025-01-01T00:00:00 + 30At runtime it throws InvalidPrecision: 1. There is no CQL semantics for adding a bare integer to a DateTime (the author almost certainly meant + 30 days). The compiler should reject the expression as a type error at translation time rather than deferring to runtime.
Expected: compile-time error along the lines of "Could not resolve call to operator Add with signature (System.DateTime, System.Integer)".
Actual: compiles, then throws InvalidPrecision: 1 at runtime.