Reify oversaturated data family instances correctly (#17296)
`TcSplice` was not properly handling oversaturated data family instances, such as the example in #17296, as it dropped arguments due to carelessly zipping data family instance arguments with `tyConTyVars`. For data families, the number of `tyConTyVars` can sometimes be less than the number of arguments it can accept in a data family instance due to the fact that data family instances can be oversaturated. To account for this, `TcSplice.mkIsPolyTvs` has now been renamed to `tyConArgsPolyKinded` and now factors in `tyConResKind` in addition to `tyConTyVars`. I've also added `Note [Reified instances and explicit kind signatures]` which explains the various subtleties in play here. Fixes #17296.
Showing
- compiler/typecheck/TcSplice.hs 118 additions, 20 deletionscompiler/typecheck/TcSplice.hs
- compiler/types/Type.hs 0 additions, 1 deletioncompiler/types/Type.hs
- testsuite/tests/th/T17296.hs 37 additions, 0 deletionstestsuite/tests/th/T17296.hs
- testsuite/tests/th/T17296.stderr 19 additions, 0 deletionstestsuite/tests/th/T17296.stderr
- testsuite/tests/th/all.T 1 addition, 0 deletionstestsuite/tests/th/all.T
Loading
Please register or sign in to comment