Skip to content

Add test for #23743

sheaf requested to merge sheaf/ghc:T23743 into master

This MR adds a test that checks the output of reifyInstances on various types, to ensure we don't accidentally change the behaviour w.r.t. #23743 (closed).

For example:

type Meta :: Type
type family Meta

type Meta1 :: Type -> Type
type family Meta1

type Meta1' :: Type -> Type
type family Meta1' a

type Skolem :: Type
data family Skolem

type C :: Type -> Constraint
class C a
instance C Int
instance C (Maybe a)
instance {-# OVERLAPPING #-} C a

We expect the following output for reifyInstances at class C with the given type argument:

  • Meta
    all 3 instances (behaves like a metavariable)

  • Skolem
    only the C a instance (behaves like a skolem type variable)

  • Meta1 Meta
    only the C a and C (Maybe a) instances, because Meta1 is generative

  • Meta1' {Meta, Skolem}
    all instances, because Meta1' is a type family with arity 1 applied to one argument, so behaves like a normal metavariable

Edited by sheaf

Merge request reports