Fix #15637 by using VTA more in GND
Summary: The code that GND was generating before could crumple over if it derived an instance for a class with an ambiguous type variable in the class head, such as the example in #15637. The solution is straightforward: simply instantiate all variables bound by the class head explicitly using visible type application, which will nip any ambiguity in the bud. Test Plan: make test TEST=T15637 Reviewers: bgamari, simonpj, goldfire Reviewed By: simonpj Subscribers: simonpj, rwbarton, carter GHC Trac Issues: #15637 Differential Revision: https://phabricator.haskell.org/D5148
Showing
- compiler/typecheck/FamInst.hs 8 additions, 4 deletionscompiler/typecheck/FamInst.hs
- compiler/typecheck/TcGenDeriv.hs 43 additions, 3 deletionscompiler/typecheck/TcGenDeriv.hs
- compiler/typecheck/TcTyClsDecls.hs 7 additions, 4 deletionscompiler/typecheck/TcTyClsDecls.hs
- compiler/typecheck/TcValidity.hs 3 additions, 1 deletioncompiler/typecheck/TcValidity.hs
- compiler/types/Type.hs 44 additions, 29 deletionscompiler/types/Type.hs
- testsuite/tests/deriving/should_compile/T14578.stderr 16 additions, 10 deletionstestsuite/tests/deriving/should_compile/T14578.stderr
- testsuite/tests/deriving/should_compile/T15637.hs 9 additions, 0 deletionstestsuite/tests/deriving/should_compile/T15637.hs
- testsuite/tests/deriving/should_compile/all.T 1 addition, 0 deletionstestsuite/tests/deriving/should_compile/all.T
- testsuite/tests/deriving/should_fail/T15073.stderr 2 additions, 2 deletionstestsuite/tests/deriving/should_fail/T15073.stderr
- testsuite/tests/deriving/should_fail/T4846.stderr 4 additions, 2 deletionstestsuite/tests/deriving/should_fail/T4846.stderr
Loading
Please register or sign in to comment