diff --git a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/env/type-alias-helper.rkt b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/env/type-alias-helper.rkt index dacc520f33..8fe6711724 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/env/type-alias-helper.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/env/type-alias-helper.rkt @@ -71,9 +71,10 @@ [((PolyRow: _ _ body)) (check body)] [(_) #t]) (unless (check type) - (tc-error/stx - id - "Recursive types are not allowed directly inside their definition"))) + (tc-error/fields + "parse error in type" + #:stx id + #:more "recursive types are not allowed directly inside their definition"))) ;; get-type-alias-info : Listof -> Listof Dict ;; diff --git a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/typecheck-tests.rkt b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/typecheck-tests.rkt index c0c7e2360c..62b052dccf 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/typecheck-tests.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/typecheck-tests.rkt @@ -2615,9 +2615,9 @@ [tc-err (let () (define-type-alias A (Class #:implements A)) "dummy") #:msg "Recursive #:implements clause not allowed"] [tc-err (let () (define-type-alias X (U X #f)) "dummy") - #:msg "Recursive types are not allowed directly inside"] + #:msg "recursive types are not allowed directly inside"] [tc-err (let () (define-type-alias X (All (A #:row) X)) "dummy") - #:msg "Recursive types are not allowed directly inside"] + #:msg "recursive types are not allowed directly inside"] ;; Check the more precise Tarjan's algorithm-based letrec-values type checking [tc-e ;; An example from Eric Dobson (see gh372) that shows that precisely