Code of Conduct
AI Policy
Versions
Elixir 1.20.2
Erlang/OTP 29 (erts-17.0.3)
ash main @ f3a27d9 (unreleased; mix.exs still says 3.31.3)
Operating system
macOS 26.5.2 (Darwin 25.5.0) aarch64
Current Behavior
range_lower(stay) == ^datetime raises on ash_postgres, and works on Ash.DataLayer.Ets.
Reproduction
in iex:
Mix.install([{:ash, github: "ash-project/ash", ref: "f3a27d9f5"}])
{:ok, c} = Ash.Type.init(Ash.Type.Range, inner_type: :datetime)
ref = %Ash.Query.Ref{
attribute: %Ash.Resource.Attribute{name: :stay, type: Ash.Type.Range, constraints: c},
relationship_path: [],
resource: nil
}
Ash.Expr.determine_types(
Ash.Query.Operator.Eq,
[%Ash.Query.Function.RangeLower{arguments: [ref]}, ~U[2026-03-01 00:00:00Z]]
)
#=> {[{Ash.Type.Range, [...]}, {Ash.Type.Range, [...]}], {Ash.Type.Boolean, []}}
Both operands come back as Ash.Type.Range, including the DateTime.
Expected Behavior
The other operand should be typed as the range's inner type. type/2 around the literal is the workaround.
Code of Conduct
AI Policy
Versions
Elixir 1.20.2
Erlang/OTP 29 (erts-17.0.3)
ash main @ f3a27d9 (unreleased; mix.exs still says 3.31.3)
Operating system
macOS 26.5.2 (Darwin 25.5.0) aarch64
Current Behavior
range_lower(stay) == ^datetime raises on ash_postgres, and works on Ash.DataLayer.Ets.
Reproduction
in iex:
Both operands come back as
Ash.Type.Range, including theDateTime.Expected Behavior
The other operand should be typed as the range's inner type.
type/2around the literal is the workaround.