diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2020-10-06 23:39:29 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2020-10-08 09:08:36 +0100 |
commit | f5d0422027d59eb3ae490ff89ff3456c456038c2 (patch) | |
tree | aab2d0162171f85e2d40bd3ff9ab5bb021a8beea /compiler/GHC/Core/DataCon.hs | |
parent | 18a3ddf75d25094096a7fe44fd250de973041187 (diff) | |
download | haskell-wip/T18809.tar.gz |
Fix desugaring of record updates on data familieswip/T18809
This fixes a long-standing bug in the desugaring of record
updates for data families, when the latter involves a GADT. It's
all explained in Note [Update for GADTs] in GHC.HsToCore.Expr.
Building the correct cast is surprisingly tricky, as that Note
explains.
Fixes #18809. The test case (in indexed-types/should_compile/T18809)
contains several examples that exercise the dark corners.
Diffstat (limited to 'compiler/GHC/Core/DataCon.hs')
-rw-r--r-- | compiler/GHC/Core/DataCon.hs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/GHC/Core/DataCon.hs b/compiler/GHC/Core/DataCon.hs index 1e3969953f..542fea4e1e 100644 --- a/compiler/GHC/Core/DataCon.hs +++ b/compiler/GHC/Core/DataCon.hs @@ -581,6 +581,7 @@ variables: purposes of TypeApplications, and as a consequence, they do not come equipped with visibilities (that is, they are TyVars/TyCoVars instead of TyCoVarBinders). + * dcUserTyVarBinders, for the type variables binders in the order in which they originally arose in the user-written type signature. Their order *does* matter for TypeApplications, so they are full TyVarBinders, complete with @@ -601,10 +602,10 @@ dcExTyCoVars. That is, the tyvars in dcUserTyVarBinders are a permutation of ordering, they in fact share the same type variables (with the same Uniques). We sometimes refer to this as "the dcUserTyVarBinders invariant". -dcUserTyVarBinders, as the name suggests, is the one that users will see most of -the time. It's used when computing the type signature of a data constructor (see -dataConWrapperType), and as a result, it's what matters from a TypeApplications -perspective. +dcUserTyVarBinders, as the name suggests, is the one that users will +see most of the time. It's used when computing the type signature of a +data constructor wrapper (see dataConWrapperType), and as a result, +it's what matters from a TypeApplications perspective. Note [The dcEqSpec domain invariant] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |