diff --git a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/types/current-seen.rkt b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/types/current-seen.rkt index f44c56a3da..33baac42e2 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/types/current-seen.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/types/current-seen.rkt @@ -17,6 +17,7 @@ (define (remember s t A) (if (or (Mu? s) (Mu? t) (Name? s) (Name? t) + (Instance? s) (Instance? t) (Struct? s) (Struct? t) (App? s) (App? t)) (cons (seen-before s t) A) diff --git a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/class-tests.rkt b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/class-tests.rkt index 3168e69ee5..1e6fb28608 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/class-tests.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/class-tests.rkt @@ -1651,4 +1651,20 @@ (: d% D) (define d% (class object% (super-new) (define/public (m) (void)))) (send (new d%) m)) - Univ])) + Univ] + ;; Test for an infinite loop bug during subtyping for classes + [tc-e (let () + (define-type-alias A% (Class [get-this (-> (Instance A%))])) + (define-type-alias B% (Class [get-this (-> (Instance B%))])) + (: a% A%) + (define a% + (class object% + (super-new) + (define/public (get-this) this))) + (: b% B%) + (define b% + (class a% + (super-new) + (define/override (get-this) this))) + (void)) + -Void]))