fix bug in ->i (neg party was getting dropped)

This commit is contained in:
Robby Findler 2020-09-24 14:30:10 -05:00
parent 5665fd8a85
commit 816e20b803
2 changed files with 12 additions and 4 deletions

View File

@ -1791,6 +1791,14 @@
'neg)
1))
(test/neg-blame
'->i-neg-party-is-being-passed-properly
'((contract (-> (->i () any) any)
(λ (x) 1)
'pos
'neg)
0))
;; this used to cause a runtime error in the code that parses ->i
(test/no-error '(->i ([x () any/c] [y (x) any/c]) any))

View File

@ -83,17 +83,17 @@
(rng-proj (blame-add-context indy-rng-blame (format "the ~a result of"
(car rng-pr))))))
(list* c-or-i-procedure
(λ (val mtd?)
(λ (val mtd? neg-party)
(if has-rest
(check-procedure/more val mtd?
(->i-mandatory-args ctc)
(->i-mandatory-kwds ctc)
(->i-opt-kwds ctc)
blame #f)
blame neg-party)
(check-procedure val mtd?
(->i-mandatory-args ctc) (->i-opt-args ctc)
(->i-mandatory-kwds ctc) (->i-opt-kwds ctc)
blame #f)))
blame neg-party)))
ctc
blame swapped-blame ;; used by the #:pre and #:post checking
(append blames
@ -969,7 +969,7 @@ evaluted left-to-right.)
#`(λ #,wrapper-proc-arglist
(λ (val neg-party)
(define blame+neg-party (cons blame neg-party))
(chk val #,method?)
(chk val #,method? neg-party)
(c-or-i-procedure
val
(let ([arg-checker