Skip to content

DateTime + Integer (no time unit) should be a compile-time type error, not a runtime InvalidPrecision exception #1800

Description

@c-schuler

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions