Fix type variable substitution in gen_Newtype_fam_insts
Previously, `gen_Newtype_fam_insts` was substituting the type variable binders of a type family instance using `substTyVars`, which failed to take type variable dependencies into account. There is similar code in `GHC.Tc.TyCl.Class.tcATDefault` that _does_ perform this substitution properly, so this patch: 1. Factors out this code into a top-level `substATBndrs` function, and 2. Uses `substATBndrs` in `gen_Newtype_fam_insts`. Fixes #23329.
parent
00a8a5ff
Pipeline #66345 failed
Stage: tool-lint
Stage: quick-build
Stage: full-build
Stage: packaging
Stage: testing
Showing
- compiler/GHC/Tc/Deriv/Generate.hs 3 additions, 2 deletionscompiler/GHC/Tc/Deriv/Generate.hs
- compiler/GHC/Tc/TyCl/Class.hs 64 additions, 5 deletionscompiler/GHC/Tc/TyCl/Class.hs
- testsuite/tests/deriving/should_compile/T23329.hs 9 additions, 0 deletionstestsuite/tests/deriving/should_compile/T23329.hs
- testsuite/tests/deriving/should_compile/T23329_M.hs 17 additions, 0 deletionstestsuite/tests/deriving/should_compile/T23329_M.hs
- testsuite/tests/deriving/should_compile/all.T 1 addition, 0 deletionstestsuite/tests/deriving/should_compile/all.T
Loading
Please register or sign in to comment