97jaz / gregor

Date and time library for Racket
45 stars 10 forks source link

at-time breaks contract #17

Closed acarrico closed 7 years ago

acarrico commented 7 years ago

Example from manual:

(require gregor) > (at-time (date 1970) (time 14 30)) cpu time: 0 real time: 0 gc time: 0 ; at-time: contract violation ; expected: time-provider? ; given: 30 ; in: the t argument of ; (->i ; ((d date-provider?) (t time-provider?)) ; (#:resolve-offset ; (resolve ; (-> ; (or/c tzgap? tzoverlap?) ; DateTime? ; string? ; (or/c Moment? #f) ; Moment?))) ; (result datetime-provider?)) ; contract from: ; /gregor-lib/gregor/main.rkt ; blaming: top-level ; (assuming the contract is correct) ; at: /gregor-lib/gregor/main.rkt:138.2

acarrico commented 7 years ago

Ah, (require gregor/time) fixes this.