diff --git a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/private/parse-type.rkt b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/private/parse-type.rkt index d2818a76..42194985 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/private/parse-type.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/private/parse-type.rkt @@ -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) diff --git a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/parse-type-tests.rkt b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/parse-type-tests.rkt index a438d808..5ef89958 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/parse-type-tests.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/parse-type-tests.rkt @@ -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)