make the code that does the mixin checks work with define-local-member-name
closes PR 11279 closes PR 12397
This commit is contained in:
parent
dd02f5eeda
commit
6e2fb2ac5e
|
@ -5014,9 +5014,11 @@ An example
|
||||||
[(_ (from ...) (to ...) clauses ...)
|
[(_ (from ...) (to ...) clauses ...)
|
||||||
(let ([extract-renamed-names
|
(let ([extract-renamed-names
|
||||||
(λ (x)
|
(λ (x)
|
||||||
(map (λ (x) (syntax-case x ()
|
(map (λ (x)
|
||||||
|
(localize
|
||||||
|
(syntax-case x ()
|
||||||
[(internal-name external-name) (syntax external-name)]
|
[(internal-name external-name) (syntax external-name)]
|
||||||
[else x]))
|
[else x])))
|
||||||
(syntax->list x)))])
|
(syntax->list x)))])
|
||||||
(define (get-super-names stx)
|
(define (get-super-names stx)
|
||||||
(syntax-case stx (inherit rename
|
(syntax-case stx (inherit rename
|
||||||
|
@ -5077,7 +5079,7 @@ An example
|
||||||
(let ([to-ids to] ...)
|
(let ([to-ids to] ...)
|
||||||
(check-mixin-from-interfaces (list from-ids ...))
|
(check-mixin-from-interfaces (list from-ids ...))
|
||||||
(check-mixin-to-interfaces (list to-ids ...))
|
(check-mixin-to-interfaces (list to-ids ...))
|
||||||
(check-interface-includes (list (quote super-vars) ...)
|
(check-interface-includes (list (quasiquote super-vars) ...)
|
||||||
(list from-ids ...))
|
(list from-ids ...))
|
||||||
mixin-expr)))))))]))
|
mixin-expr)))))))]))
|
||||||
|
|
||||||
|
|
|
@ -1675,4 +1675,25 @@
|
||||||
|
|
||||||
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
;; ----------------------------------------
|
||||||
|
;; Mixins
|
||||||
|
|
||||||
|
(let ()
|
||||||
|
(define-local-member-name m)
|
||||||
|
(define i<%> (interface () m n))
|
||||||
|
(define mix
|
||||||
|
(mixin (i<%>) ()
|
||||||
|
(inherit m n)
|
||||||
|
(super-new)
|
||||||
|
(define/public (x) (+ (m) (n)))))
|
||||||
|
(define c%
|
||||||
|
(class* object% (i<%>)
|
||||||
|
(define/public (m) 1)
|
||||||
|
(define/public (n) 2)
|
||||||
|
(super-new)))
|
||||||
|
(test 3 'mixin-with-local-member-names (send (new (mix c%)) x)))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
(report-errs)
|
(report-errs)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user