Be mindful of GADT tyvar order when desugaring record updates
After commit ef26182e, the type variable binders in GADT constructor type signatures are now quantified in toposorted order, instead of always having all the universals before all the existentials. Unfortunately, that commit forgot to update some code (which was assuming the latter scenario) in `DsExpr` which desugars record updates. This wound up being the cause of #15499. This patch makes up for lost time by desugaring record updates in a way such that the desugared expression applies type arguments to the right-hand side constructor in the correct order—that is, the order in which they were quantified by the user. Test Plan: make test TEST=T15499 Reviewers: simonpj, bgamari Reviewed By: simonpj Subscribers: rwbarton, carter GHC Trac Issues: #15499 Differential Revision: https://phabricator.haskell.org/D5060 (cherry picked from commit 63b6a1d4)
Showing
- compiler/deSugar/DsExpr.hs 17 additions, 8 deletionscompiler/deSugar/DsExpr.hs
- testsuite/tests/typecheck/should_compile/T15499.hs 11 additions, 0 deletionstestsuite/tests/typecheck/should_compile/T15499.hs
- testsuite/tests/typecheck/should_compile/all.T 1 addition, 0 deletionstestsuite/tests/typecheck/should_compile/all.T
Loading
Please register or sign in to comment