fixed bug in list/c's first-order checking code

This commit is contained in:
Robby Findler 2012-02-25 14:17:06 -06:00
parent 645ca02e92
commit df504d482e
2 changed files with 6 additions and 1 deletions

View File

@ -698,7 +698,7 @@
(= (length x) (length (generic-list/c-args c)))
(for/and ([arg/c (in-list (generic-list/c-args c))]
[v (in-list x)])
(arg/c v))))
((contract-first-order arg/c) v))))
(struct generic-list/c (args))

View File

@ -10453,6 +10453,11 @@ so that propagation occurs.
(ctest #t contract-first-order-passes? (listof integer?) (list 1))
(ctest #f contract-first-order-passes? (listof integer?) #f)
(ctest #f contract-first-order-passes? (list/c #f #f #t) (list))
(ctest #t contract-first-order-passes? (list/c #f 'x #t) (list #f 'x #t))
(ctest #f contract-first-order-passes? (list/c (-> number? number?)) (list (λ (x y) x)))
(ctest #t contract-first-order-passes? (list/c (-> number? number?)) (list (λ (x) x)))
(ctest #t contract-first-order-passes? (non-empty-listof integer?) (list 1))
(ctest #f contract-first-order-passes? (non-empty-listof integer?) (list))