[commit: ghc] wip/rae: Fix #11797. (533ff9c)

git at git.haskell.org git at git.haskell.org
Wed Apr 6 14:37:32 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/rae
Link       : http://ghc.haskell.org/trac/ghc/changeset/533ff9c52d1e122ab6e86ad8cd344ecc1a43dae3/ghc

>---------------------------------------------------------------

commit 533ff9c52d1e122ab6e86ad8cd344ecc1a43dae3
Author: Richard Eisenberg <eir at cis.upenn.edu>
Date:   Wed Apr 6 16:37:22 2016 +0200

    Fix #11797.
    
    DsMeta curiously omitted quantified tyvars in certain circumstances.
    This patch means it doesn't.


>---------------------------------------------------------------

533ff9c52d1e122ab6e86ad8cd344ecc1a43dae3
 compiler/deSugar/DsMeta.hs | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/compiler/deSugar/DsMeta.hs b/compiler/deSugar/DsMeta.hs
index 84f1a9c..3bc4ae9 100644
--- a/compiler/deSugar/DsMeta.hs
+++ b/compiler/deSugar/DsMeta.hs
@@ -872,12 +872,9 @@ repContext ctxt = do preds <- repList typeQTyConName repLTy ctxt
                      repCtxt preds
 
 repHsSigType :: LHsSigType Name -> DsM (Core TH.TypeQ)
-repHsSigType ty = repLTy (hsSigType ty)
-
-repHsSigWcType :: LHsSigWcType Name -> DsM (Core TH.TypeQ)
-repHsSigWcType (HsIB { hsib_vars = vars
-                     , hsib_body = sig1 })
-  | (explicit_tvs, ctxt, ty) <- splitLHsSigmaTy (hswc_body sig1)
+repHsSigType (HsIB { hsib_vars = vars
+                   , hsib_body = body })
+  | (explicit_tvs, ctxt, ty) <- splitLHsSigmaTy body
   = addTyVarBinds (HsQTvs { hsq_implicit = []
                           , hsq_explicit = map (noLoc . UserTyVar . noLoc) vars ++
                                            explicit_tvs
@@ -889,6 +886,10 @@ repHsSigWcType (HsIB { hsib_vars = vars
          then return th_ty
          else repTForall th_tvs th_ctxt th_ty }
 
+repHsSigWcType :: LHsSigWcType Name -> DsM (Core TH.TypeQ)
+repHsSigWcType ib_ty@(HsIB { hsib_body = sig1 })
+  = repHsSigType (ib_ty { hsib_body = hswc_body sig1 })
+
 -- yield the representation of a list of types
 --
 repLTys :: [LHsType Name] -> DsM [Core TH.TypeQ]



More information about the ghc-commits mailing list