mirror of
https://github.com/CatalaLang/catala.git
synced 2024-11-08 07:51:43 +03:00
Fixes wrong typing for date subtraction operator (#559)
This commit is contained in:
commit
ca22e86c26
@ -435,7 +435,7 @@ let resolved_type ((op : resolved t), pos) =
|
||||
| Sub_rat_rat -> [TRat; TRat], TRat
|
||||
| Sub_mon_mon -> [TMoney; TMoney], TMoney
|
||||
| Sub_dat_dat -> [TDate; TDate], TDuration
|
||||
| Sub_dat_dur -> [TDate; TDuration], TDuration
|
||||
| Sub_dat_dur -> [TDate; TDuration], TDate
|
||||
| Sub_dur_dur -> [TDuration; TDuration], TDuration
|
||||
| Mult_int_int -> [TInt; TInt], TInt
|
||||
| Mult_rat_rat -> [TRat; TRat], TRat
|
||||
|
32
tests/test_date/bad/substraction.catala_en
Normal file
32
tests/test_date/bad/substraction.catala_en
Normal file
@ -0,0 +1,32 @@
|
||||
```catala
|
||||
declaration scope A:
|
||||
output o content boolean
|
||||
|
||||
scope A:
|
||||
definition o equals |2024-01-16| - 0 day <= 0 day
|
||||
```
|
||||
|
||||
```catala-test-inline
|
||||
$ catala Interpret -s A
|
||||
[ERROR]
|
||||
I don't know how to apply operator <= on types date and
|
||||
duration
|
||||
|
||||
┌─⯈ tests/test_date/bad/substraction.catala_en:6.23-6.52:
|
||||
└─┐
|
||||
6 │ definition o equals |2024-01-16| - 0 day <= 0 day
|
||||
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
||||
|
||||
Type date coming from expression:
|
||||
┌─⯈ tests/test_date/bad/substraction.catala_en:6.23-6.43:
|
||||
└─┐
|
||||
6 │ definition o equals |2024-01-16| - 0 day <= 0 day
|
||||
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
||||
|
||||
Type duration coming from expression:
|
||||
┌─⯈ tests/test_date/bad/substraction.catala_en:6.47-6.52:
|
||||
└─┐
|
||||
6 │ definition o equals |2024-01-16| - 0 day <= 0 day
|
||||
│ ‾‾‾‾‾
|
||||
#return code 123#
|
||||
```
|
Loading…
Reference in New Issue
Block a user