parent
fdad73df32
commit
253f0f4383
|
@ -595,7 +595,25 @@
|
|||
(write (compile '(f)) o)
|
||||
(test #t 'same? (eval (parameterize ([read-accept-compiled #t])
|
||||
(read (open-input-bytes (get-output-bytes o))))))))
|
||||
|
||||
|
||||
;; ----------------------------------------
|
||||
;; Check prop:arity-string
|
||||
|
||||
(err/rt-test (let ()
|
||||
(struct a (x)
|
||||
#:property prop:arity-string 'bad)
|
||||
(a 0)))
|
||||
|
||||
(err/rt-test (let ()
|
||||
(struct evens (proc)
|
||||
#:property prop:procedure (struct-field-index proc)
|
||||
#:property prop:arity-string
|
||||
(lambda (p)
|
||||
"an even number of arguments"))
|
||||
((evens (lambda (x y) x)) 100))
|
||||
exn:fail:contract?
|
||||
#rx"an even number of arguments")
|
||||
|
||||
;; ----------------------------------------
|
||||
|
||||
(report-errs)
|
||||
|
|
|
@ -2,7 +2,11 @@
|
|||
(make-struct-type-property 'method-arity-error))
|
||||
|
||||
(define-values (prop:arity-string arity-string? arity-string-ref)
|
||||
(make-struct-type-property 'arity-string))
|
||||
(make-struct-type-property 'arity-string (lambda (v info)
|
||||
(check 'guard-for-prop:arity-string
|
||||
(procedure-arity-includes/c 1)
|
||||
v)
|
||||
v)))
|
||||
|
||||
(define-values (prop:procedure procedure-struct? procedure-struct-ref)
|
||||
(make-struct-type-property 'procedure (lambda (v info)
|
||||
|
|
Loading…
Reference in New Issue
Block a user