Check struct predicate before checking fields.

original commit: 3b0de9c141edee84be57768a22b1ae3264fcc7f5
This commit is contained in:
Stevie Strickland 2010-09-02 16:28:10 -04:00
parent 721c939b95
commit 3e6ab819c6

View File

@ -196,6 +196,8 @@
#:projection
(lambda (blame)
(lambda (val)
(unless (#,pred? val)
(raise-blame-error blame val "expected ~a value, got ~v" 'cnt-name val))
(maker fld-cnts ...))))])
rec))]
[else #`(flat-named-contract '#,(syntax-e pred?) #,(cert pred?))])]