# (define-type … (Instance X)) breaks when X is a parametric type synonym, since Racket 8.7

**URL:** <https://racket.discourse.group/t/define-type-instance-x-breaks-when-x-is-a-parametric-type-synonym-since-racket-8-7/1682>\
**Category:** Questions & Answers\
**Tags:** typed-racket\
**Created:** [February 3, 2023, 10:37am UTC](https://racket.discourse.group/t/define-type-instance-x-breaks-when-x-is-a-parametric-type-synonym-since-racket-8-7/1682 "2023-02-03T10:37:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![scolobb](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/scolobb/32/108_2.png) [@scolobb](https://racket.discourse.group/u/scolobb)\
**Post date:** [February 3, 2023, 10:37am UTC](https://racket.discourse.group/t/define-type-instance-x-breaks-when-x-is-a-parametric-type-synonym-since-racket-8-7/1682/1 "2023-02-03T10:37:28Z")

</div>

Hi,

Suppose I have the following typed class:

```scheme
(define my-class%
  (class object%
    #:forall (A)
    (super-new)
    (init-field [x : A])
    (define/public (get-x) x)))

```

I can define a synonym for the type of this class and then use it like so:

```scheme
(define-type (MyClass% A) (Class (field (x A)) (get-x (-> A))))
(: a (Instance (MyClass% Boolean)))
(define a (new (inst my-class% Boolean) [x #t]))

```

I can also define a synonym for _an instance_ of this class type, fully spelled out:

```scheme
(define-type (MyClassInstance A) (Instance (Class (field (x A)) (get-x (-> A)))))

```

However, the following breaks, since Racket 8.7 I think:

```scheme
(define-type (MyClassInstance A) (Instance (MyClass% A)))
; Type Checker: parse error in type;
; expected a class type for argument to Instance
; given: (MyClass% A)
; in: (Instance (MyClass% A))

```

This used to work with Racket 8.6 as far as I remember (I had a long day-job blackout 😃 )

Is this breakage intended or a bug?

---

<div class="post-metadata">

**Author:** ![capfredf](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/capfredf/32/935_2.png) [@capfredf](https://racket.discourse.group/u/capfredf)\
**Post date:** [February 3, 2023, 4:46pm UTC](https://racket.discourse.group/t/define-type-instance-x-breaks-when-x-is-a-parametric-type-synonym-since-racket-8-7/1682/2 "2023-02-03T16:46:06Z")

</div>

This is a bug.  
I will file a bug and take a look at it.
