fix interaction of mixins and contracted classes

This commit is contained in:
Robby Findler 2014-02-08 09:09:25 -06:00
parent 72ef0a9323
commit 788ec1d87d
2 changed files with 18 additions and 1 deletions

View File

@ -2295,6 +2295,23 @@
(with-method ([m (o m)])
(m #f))))
(test/spec-passed
'mixin1
'((mixin () () (super-new))
(contract (class/c m)
(class object% (define/public (m x) x) (super-new))
'pos
'neg)))
(test/spec-passed
'mixin2
'(send (new ((mixin () () (super-new))
(contract (class/c [m (->m integer? integer?)])
(class object% (define/public (m x) x) (super-new))
'pos
'neg)))
m 1))
(let ([expected-given?
(λ (exn) (and (regexp-match? #rx"callback: contract violation" (exn-message exn))
(regexp-match? #rx"expected: boolean[?]" (exn-message exn))

View File

@ -4340,7 +4340,7 @@ An example
(define (check-mixin-super mixin-name super% from-ids)
(let ([mixin-name (or mixin-name 'mixin)])
(unless (class? super%)
(unless (-class? super%)
(obj-error mixin-name
"argument is not a class"
"argument" super%))