diff options
author | Ryan Scott <ryan.gl.scott@gmail.com> | 2022-09-10 20:09:47 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-09-18 08:00:44 -0400 |
commit | 8a666ad2a89a8ad2aa24a6406b88f516afaec671 (patch) | |
tree | 179ebe5c1819bc4914920770454c9039a65ecbb0 /compiler/Language/Haskell/Syntax/Module | |
parent | bd0f418422a3ace8d05c8ce93850190e57321465 (diff) | |
download | haskell-8a666ad2a89a8ad2aa24a6406b88f516afaec671.tar.gz |
DeriveFunctor: Check for last type variables using dataConUnivTyVars
Previously, derived instances of `Functor` (as well as the related classes
`Foldable`, `Traversable`, and `Generic1`) would determine which constraints to
infer by checking for fields that contain the last type variable. The problem
was that this last type variable was taken from `tyConTyVars`. For GADTs, the
type variables in each data constructor are _not_ the same type variables as
in `tyConTyVars`, leading to #22167.
This fixes the issue by instead checking for the last type variable using
`dataConUnivTyVars`. (This is very similar in spirit to the fix for #21185,
which also replaced an errant use of `tyConTyVars` with type variables from
each data constructor.)
Fixes #22167.
Diffstat (limited to 'compiler/Language/Haskell/Syntax/Module')
0 files changed, 0 insertions, 0 deletions