Catch #:row-var parsing problems in TR
Closes PR 14434 original commit: e692edc180be26c92726dffd1a595d4db3e25560
This commit is contained in:
parent
79ba079b63
commit
dc3ef29b18
|
@ -704,10 +704,20 @@
|
|||
(and (attribute clause.init-rest)
|
||||
(parse-type (attribute clause.init-rest))))
|
||||
|
||||
;; Only proceed to create a class type when the parsing
|
||||
;; process isn't looking for recursive type alias references.
|
||||
;; (otherwise the merging process will error)
|
||||
(cond [(or (null? parent-stxs)
|
||||
(cond ;; If an Error type flows into the #:row-var position, a
|
||||
;; delayed error should be raised from the recursive call to
|
||||
;; `parse-type` so no additional error is needed here.
|
||||
[(Error? given-row-var) Err]
|
||||
[(not (F? given-row-var))
|
||||
(tc-error/fields "parse error in type"
|
||||
#:more "expected a type variable for #:row-var"
|
||||
"given" given-row-var
|
||||
#:delayed? #t)
|
||||
Err]
|
||||
;; Only proceed to create a class type when the parsing
|
||||
;; process isn't looking for recursive type alias references.
|
||||
;; (otherwise the merging process will error)
|
||||
[(or (null? parent-stxs)
|
||||
(not (current-referenced-aliases)))
|
||||
|
||||
(check-function-types given-methods)
|
||||
|
|
|
@ -242,6 +242,7 @@
|
|||
[FAIL (All (r #:row) (Class #:implements (Class) #:row-var r))]
|
||||
[FAIL (Class #:row-var 5)]
|
||||
[FAIL (Class #:row-var (list 3))]
|
||||
[FAIL (Class #:row-var x)]
|
||||
[FAIL (Class #:implements (Class #:row-var r) #:row-var x)]
|
||||
[FAIL (Class #:implements (Class #:row-var r) #:row-var r)]
|
||||
[FAIL (All (r #:row)
|
||||
|
|
Loading…
Reference in New Issue
Block a user