fix: allow subtraction of durations from dates (#8247)

`date` - `duration` is
[implemented](ba5258d716/crates/nu-protocol/src/value/mod.rs (L2145))
but the type checker rejects it

this pr fixes that
This commit is contained in:
mike
2023-02-27 23:17:58 +03:00
committed by GitHub
parent ba5258d716
commit 0a2e711351
2 changed files with 15 additions and 0 deletions

View File

@ -107,6 +107,7 @@ pub fn math_result_type(
(Type::Int, Type::Float) => (Type::Float, None),
(Type::Float, Type::Float) => (Type::Float, None),
(Type::Date, Type::Date) => (Type::Duration, None),
(Type::Date, Type::Duration) => (Type::Date, None),
(Type::Duration, Type::Duration) => (Type::Duration, None),
(Type::Filesize, Type::Filesize) => (Type::Filesize, None),