Skip to content
Snippets Groups Projects
Forked from Glasgow Haskell Compiler / GHC
Loading
sheaf's avatar
sheaf authored
This commit makes 'makeTypeConcrete' a bit smarter when attempting to
make a type concrete. For example; suppose we want to make

  TYPE a[sk]

concrete. We used to simply create a concrete metavariable kappa
and emit

  [W] kappa[conc] ~# TYPE a[sk]

With this patch, we instead create the concrete metavariable gamma and
emit

  [W] gamma[conc] ~# a[sk]

which is equivalent to decomposing the previous equality with the
substitution

  kappa[conc] := TYPE gamma[conc]

These changes mean that the compiler no longer panics on calls such as

  typeTypeOrConstraint kappa
  getRuntimeRep kappa

because we will instead be calling

  typeTypeOrConstraint (TYPE gamma) = TypeLike
  getRuntimeRep (TYPE gamma) = gamma

See Note [Decompose when making a type concrete]
in GHC.Tc.Utils.Concrete.

Fixes #23883
385ffe62
History
Name Last commit Last update