Added special case to the typechecker for (- <positive-fixnum> 1).

original commit: c6373ca7c09ec74e50e8b435b9a0387310c1b202
This commit is contained in:
Vincent St-Amour 2010-06-28 16:03:04 -04:00
parent be0e26235a
commit fc1a0a9e05

View File

@ -608,7 +608,8 @@
[(#%plain-app (~and op (~literal -)) v (~and arg2 ((~literal quote) 1)))
(add-typeof-expr #'arg2 (ret -PositiveFixnum))
(match-let ([(tc-result1: t) (single-value #'v)])
(cond
(cond
[(subtype t -PositiveFixnum) (ret (Un -Zero -PositiveFixnum))]
[(subtype t (Un -Zero -PositiveFixnum)) (ret -Fixnum)]
[(subtype t -ExactPositiveInteger) (ret -Nat)]
[else (tc/funapp #'op #'(v arg2) (single-value #'op) (list (ret t) (single-value #'arg2)) expected)]))]