Don't add super-type inits into type with #:extends
This commit is contained in:
parent
bbd5d97a23
commit
4543204e85
|
@ -619,9 +619,6 @@
|
||||||
|
|
||||||
;; if any duplicates are found between this class and the superclass
|
;; if any duplicates are found between this class and the superclass
|
||||||
;; type, then raise an error
|
;; type, then raise an error
|
||||||
(check-duplicate-clause
|
|
||||||
(append init-names init-field-names super-init-names)
|
|
||||||
"init or init-field name ~a conflicts with #:extends clause")
|
|
||||||
(check-duplicate-clause
|
(check-duplicate-clause
|
||||||
(append field-names init-field-names super-field-names)
|
(append field-names init-field-names super-field-names)
|
||||||
"field or init-field name ~a conflicts with #:extends clause")
|
"field or init-field name ~a conflicts with #:extends clause")
|
||||||
|
@ -629,14 +626,12 @@
|
||||||
(append method-names super-method-names)
|
(append method-names super-method-names)
|
||||||
"method name ~a conflicts with #:extends clause")
|
"method name ~a conflicts with #:extends clause")
|
||||||
|
|
||||||
;; then append the super types if there were no errors
|
|
||||||
(define inits
|
(define inits
|
||||||
(append
|
(map list
|
||||||
super-inits
|
(append init-names init-field-names)
|
||||||
(map list
|
(append init-types init-field-types)
|
||||||
(append init-names init-field-names)
|
(append init-optional?s init-field-optional?s)))
|
||||||
(append init-types init-field-types)
|
;; then append the super types if there were no errors
|
||||||
(append init-optional?s init-field-optional?s))))
|
|
||||||
(define fields
|
(define fields
|
||||||
(append
|
(append
|
||||||
super-fields
|
super-fields
|
||||||
|
|
|
@ -225,6 +225,9 @@
|
||||||
;; test #:extends
|
;; test #:extends
|
||||||
[(Class #:extends (Class [m (Number -> Number)]) (field [x Number]))
|
[(Class #:extends (Class [m (Number -> Number)]) (field [x Number]))
|
||||||
(make-Class #f null `((x ,-Number)) `((m ,(t:-> N N))))]
|
(make-Class #f null `((x ,-Number)) `((m ,(t:-> N N))))]
|
||||||
|
[(Class #:extends (Class (init [x Integer]) [m (Number -> Number)])
|
||||||
|
(field [x Number]))
|
||||||
|
(make-Class #f null `((x ,-Number)) `((m ,(t:-> N N))))]
|
||||||
[FAIL (Class #:extends (Class [m (Number -> Number)]) [m String])]
|
[FAIL (Class #:extends (Class [m (Number -> Number)]) [m String])]
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user