TR: fix error case when superclass is not a class
This commit is contained in:
parent
0bacba7a68
commit
a0ce1fa02c
|
@ -329,9 +329,12 @@
|
|||
(values super-row super-inits super-fields
|
||||
super-methods super-augments super-init-rest)]
|
||||
[(tc-result1: t)
|
||||
(tc-error/expr "expected a superclass but got value of type ~a" t
|
||||
#:stx (hash-ref parse-info 'superclass-expr))
|
||||
(values #f null null null null)]))
|
||||
(tc-error/expr/fields "type mismatch"
|
||||
#:more "superclass expression should produce a class"
|
||||
#:stx (hash-ref parse-info 'superclass-expr)
|
||||
"expected" "a class"
|
||||
"given" t)
|
||||
(values #f null null null null #f)]))
|
||||
(define super-init-names (dict-keys super-inits))
|
||||
(define super-field-names (dict-keys super-fields))
|
||||
(define super-method-names (dict-keys super-methods))
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
(init x)
|
||||
(define/public (m x) 0)))
|
||||
(void))
|
||||
#:msg #rx"expected a superclass but"]
|
||||
#:msg #rx"superclass expression should produce a class"]
|
||||
;; Method using argument type
|
||||
[tc-e (let ()
|
||||
(: e% (Class (init [x Integer])
|
||||
|
@ -173,6 +173,9 @@
|
|||
(define n% (class j% (super-new)))
|
||||
(void))
|
||||
-Void]
|
||||
;; fail, superclass expression is not a class with no expected type
|
||||
[tc-err (class "foo" (super-new))
|
||||
#:msg "expected: a class"]
|
||||
;; should fail, too many methods
|
||||
[tc-err (let ()
|
||||
(: o% (Class))
|
||||
|
|
Loading…
Reference in New Issue
Block a user