Don't add super-type inits into type with #:extends
original commit: 4543204e859cddfa6abacd52ff725ceb6dca6ee6
This commit is contained in:
parent
defa74d44a
commit
9ca8361ced
|
@ -619,9 +619,6 @@
|
|||
|
||||
;; if any duplicates are found between this class and the superclass
|
||||
;; 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
|
||||
(append field-names init-field-names super-field-names)
|
||||
"field or init-field name ~a conflicts with #:extends clause")
|
||||
|
@ -629,14 +626,12 @@
|
|||
(append method-names super-method-names)
|
||||
"method name ~a conflicts with #:extends clause")
|
||||
|
||||
;; then append the super types if there were no errors
|
||||
(define inits
|
||||
(append
|
||||
super-inits
|
||||
(map list
|
||||
(append init-names init-field-names)
|
||||
(append init-types init-field-types)
|
||||
(append init-optional?s init-field-optional?s))))
|
||||
(map list
|
||||
(append init-names init-field-names)
|
||||
(append init-types init-field-types)
|
||||
(append init-optional?s init-field-optional?s)))
|
||||
;; then append the super types if there were no errors
|
||||
(define fields
|
||||
(append
|
||||
super-fields
|
||||
|
|
|
@ -225,6 +225,9 @@
|
|||
;; test #:extends
|
||||
[(Class #:extends (Class [m (Number -> Number)]) (field [x Number]))
|
||||
(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])]
|
||||
))
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user