As shown in #7734 and #7733 the logic in typerel fails to determine that `type Foo` and `type Foo` are indeed equal. Fixes #7734