fix error message in ->i
in the case where the dependened on contract is a first-order contract, there is a shortcircuit that incorrectly formulated the error message
This commit is contained in:
parent
11927aea37
commit
041cebc9c0
|
@ -1440,4 +1440,22 @@
|
|||
(λ (x y) x)
|
||||
'pos 'neg) 1 2)
|
||||
"didn't raise an error")
|
||||
#t))
|
||||
#t)
|
||||
|
||||
(test/spec-passed/result
|
||||
'shortcut-error-message
|
||||
'(with-handlers ([exn:fail?
|
||||
(λ (x) (define m
|
||||
(regexp-match #rx"expected: ([^\n]*)\n"
|
||||
(exn-message x)))
|
||||
(if m
|
||||
(list-ref m 1)
|
||||
(format "ack regexp didn't match: ~s"
|
||||
(exn-message x))))])
|
||||
((contract (->i ([y () (and/c number? (>/c 1))]) any)
|
||||
(λ (y) 1)
|
||||
'pos 'neg)
|
||||
1))
|
||||
"(and/c number? (>/c 1))")
|
||||
|
||||
)
|
||||
|
|
|
@ -1090,7 +1090,7 @@ evaluted left-to-right.)
|
|||
(if (orig-ctc obj)
|
||||
obj
|
||||
(raise-predicate-blame-error-failure blame obj neg-party
|
||||
(object-name orig-ctc)))]
|
||||
(contract-name orig-ctc)))]
|
||||
[else
|
||||
(define ctc (if chaperone?
|
||||
(coerce-chaperone-contract '->i orig-ctc)
|
||||
|
|
Loading…
Reference in New Issue
Block a user