Fix object/c contract-stronger?
This commit is contained in:
parent
c02d91d174
commit
3b56866fc1
|
@ -299,5 +299,39 @@
|
|||
(class object% (super-new)))
|
||||
'pos 'neg))
|
||||
|
||||
(test/spec-passed/result
|
||||
'object/c-multi-wrap-just-check-existence/field
|
||||
'(let ([ctc (object/c (field foo))]
|
||||
[v (new (class object% (super-new) (field (foo 0))))])
|
||||
(get-field
|
||||
foo
|
||||
(contract
|
||||
ctc
|
||||
(contract
|
||||
ctc
|
||||
(contract
|
||||
ctc
|
||||
v
|
||||
'p 'n)
|
||||
'p 'n)
|
||||
'p 'n)))
|
||||
0)
|
||||
|
||||
(test/spec-passed/result
|
||||
'object/c-multi-wrap-just-check-existence/method
|
||||
'(let ([ctc (object/c foo)]
|
||||
[v (new (class object% (super-new) (define/public (foo) 0)))])
|
||||
(send
|
||||
(contract
|
||||
ctc
|
||||
(contract
|
||||
ctc
|
||||
(contract
|
||||
ctc
|
||||
v
|
||||
'p 'n)
|
||||
'p 'n)
|
||||
'p 'n)
|
||||
foo))
|
||||
0)
|
||||
)
|
||||
|
|
|
@ -1521,7 +1521,13 @@
|
|||
(for/or ([that-name (in-list (names-sel that))]
|
||||
[that-ctc (in-list (ctcs-sel that))])
|
||||
(and (equal? this-name that-name)
|
||||
(contract-stronger? this-ctc that-ctc))))))
|
||||
(contract-stronger?
|
||||
(if (just-check-existence? this-ctc)
|
||||
any/c
|
||||
this-ctc)
|
||||
(if (just-check-existence? that-ctc)
|
||||
any/c
|
||||
that-ctc)))))))
|
||||
|
||||
(define-struct base-object/c (methods method-contracts fields field-contracts)
|
||||
#:property prop:custom-write custom-write-property-proc
|
||||
|
|
Loading…
Reference in New Issue
Block a user