_enum: allow negative integers

Corrects a problem with ad899173b9
This commit is contained in:
Matthew Flatt 2015-03-26 20:14:45 -06:00
parent ad899173b9
commit 1a5e3e5953
2 changed files with 4 additions and 1 deletions

View File

@ -164,6 +164,9 @@
(error-test #'(_enum '(x = y)) _enum-exn?)
(error-test #'(_enum '(x y) #:unknown (lambda (x y) x)) _enum-exn?))
(test 5 cast 'foo (_enum '(foo = 5)) _int)
(test -5 cast 'bar (_enum '(bar = -5)) _int)
(define-cstruct _ic7i ([i1 _int]
[c7 _c7_list]
[i2 _int]))

View File

@ -820,7 +820,7 @@
"symbols" symbols
"key" sym
"value" i))
(unless (exact-nonnegative-integer? i)
(unless (exact-integer? i)
(raise-arguments-error '_enum "value is not an integer"
"symbols" symbols
"key" sym