cs: adjust default prompt abort handler arity error message
This commit is contained in:
parent
6389b18b01
commit
afff5ca7ac
|
@ -668,6 +668,22 @@
|
|||
(default-continuation-prompt-tag)
|
||||
list)
|
||||
|
||||
;;----------------------------------------
|
||||
;; Check error message as "result" or not
|
||||
|
||||
(err/rt-test (call-with-continuation-prompt (lambda () (abort-current-continuation (default-continuation-prompt-tag))))
|
||||
exn:fail:contract:arity?
|
||||
#rx"result arity mismatch")
|
||||
(err/rt-test (call-with-continuation-prompt (lambda () (abort-current-continuation (default-continuation-prompt-tag)))
|
||||
(default-continuation-prompt-tag))
|
||||
exn:fail:contract:arity?
|
||||
#rx"result arity mismatch")
|
||||
(err/rt-test (call-with-continuation-prompt (lambda () (abort-current-continuation (default-continuation-prompt-tag)))
|
||||
(default-continuation-prompt-tag)
|
||||
(lambda (x) x))
|
||||
exn:fail:contract:arity?
|
||||
#rx": arity mismatch")
|
||||
|
||||
;;----------------------------------------
|
||||
|
||||
(report-errs)
|
||||
|
|
|
@ -244,9 +244,17 @@
|
|||
(apply proc args)))]))
|
||||
|
||||
(define (make-default-abort-handler tag)
|
||||
(lambda (abort-thunk)
|
||||
(case-lambda
|
||||
[(abort-thunk)
|
||||
(check 'default-continuation-prompt-handler (procedure-arity-includes/c 0) abort-thunk)
|
||||
(call-with-continuation-prompt abort-thunk tag #f)))
|
||||
(call-with-continuation-prompt abort-thunk tag #f)]
|
||||
[args
|
||||
;; report arity error as result-arity error
|
||||
(apply raise-result-arity-error
|
||||
'call-with-continuation-prompt
|
||||
1
|
||||
"\n in: application of default prompt handler"
|
||||
args)]))
|
||||
|
||||
(define (resume-metacontinuation results)
|
||||
;; pop a metacontinuation frame
|
||||
|
|
|
@ -419,8 +419,8 @@
|
|||
(if who (string-append (symbol->string who) ": ") "")
|
||||
"result arity mismatch;\n"
|
||||
" expected number of values not received\n"
|
||||
" received: " (number->string (length args)) "\n"
|
||||
" expected: " (number->string num-expected-args)
|
||||
" expected: " (number->string num-expected-args) "\n"
|
||||
" received: " (number->string (length args))
|
||||
(or where "")
|
||||
(arguments->context-string args))
|
||||
(current-continuation-marks))))
|
||||
|
|
Loading…
Reference in New Issue
Block a user