fix the 'just check existence' part of object/c contracts
This commit is contained in:
parent
3b1b4a0d26
commit
fa4a6d4c13
|
@ -283,5 +283,21 @@
|
||||||
|
|
||||||
(send x3 p)))
|
(send x3 p)))
|
||||||
|
|
||||||
|
(test/spec-passed
|
||||||
|
'object/c-just-check-existence
|
||||||
|
'(contract (object/c m)
|
||||||
|
(new
|
||||||
|
(class object%
|
||||||
|
(super-new)
|
||||||
|
(define/public (m) 42)))
|
||||||
|
'pos 'neg))
|
||||||
|
|
||||||
|
(test/pos-blame
|
||||||
|
'object/c-just-check-existence
|
||||||
|
'(contract (object/c m)
|
||||||
|
(new
|
||||||
|
(class object% (super-new)))
|
||||||
|
'pos 'neg))
|
||||||
|
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
|
@ -1662,10 +1662,11 @@
|
||||||
(for ([m (in-list methods)]
|
(for ([m (in-list methods)]
|
||||||
[c (in-list method-contracts)])
|
[c (in-list method-contracts)])
|
||||||
(when c
|
(when c
|
||||||
(let ([i (hash-ref method-ht m)]
|
(unless (just-check-existence? c)
|
||||||
[p ((contract-late-neg-projection c)
|
(define i (hash-ref method-ht m))
|
||||||
|
(define p ((contract-late-neg-projection c)
|
||||||
(blame-add-context blame (format "the ~a method in" m)
|
(blame-add-context blame (format "the ~a method in" m)
|
||||||
#:important m))])
|
#:important m)))
|
||||||
(vector-set! meths i (make-method (p (vector-ref meths i) neg-party) m))))))
|
(vector-set! meths i (make-method (p (vector-ref meths i) neg-party) m))))))
|
||||||
|
|
||||||
;; Handle external field contracts
|
;; Handle external field contracts
|
||||||
|
|
Loading…
Reference in New Issue
Block a user