[Git][ghc/ghc][wip/jbruenker/foreach] wip changed the thing but corelint still complains

Jakob Brünker (@JakobBruenker) gitlab at gitlab.haskell.org
Mon Jul 31 01:37:18 UTC 2023



Jakob Brünker pushed to branch wip/jbruenker/foreach at Glasgow Haskell Compiler / GHC


Commits:
2f14e085 by Jakob Bruenker at 2023-07-31T03:36:49+02:00
wip changed the thing but corelint still complains

- - - - -


3 changed files:

- compiler/GHC/Core/Type.hs
- compiler/GHC/Iface/Type.hs
- compiler/GHC/Tc/Utils/Unify.hs


Changes:

=====================================
compiler/GHC/Core/Type.hs
=====================================
@@ -1952,10 +1952,8 @@ dropForAlls ty = go ty
 -- | Attempts to take a ForAllTy apart, returning the full ForAllTyBinder
 splitForAllForAllTyBinder_maybe :: Type -> Maybe (Erasure, ForAllTyBinder, Type)
 splitForAllForAllTyBinder_maybe ty
-  | ForAllTy Erased   bndr inner_ty <- coreFullView ty = Just (Erased, bndr, inner_ty)
-  | ForAllTy Retained bndr (FunTy FTF_T_T _ _ inner_ty) <- coreFullView ty = Just (Retained, bndr, inner_ty)
-  | ForAllTy Retained _ _ <- coreFullView ty = panic "splitForAllTyVarBinder_maybe: Retained binder without matching FunTy"
-  | otherwise                                        = Nothing
+  | ForAllTy eras bndr inner_ty <- coreFullView ty = Just (eras, bndr, inner_ty)
+  | otherwise                                      = Nothing
 
 
 -- | Attempts to take a ForAllTy apart, returning the Var


=====================================
compiler/GHC/Iface/Type.hs
=====================================
@@ -1289,6 +1289,7 @@ pprIfaceForAllCoPart :: [(IfLclName, IfaceCoercion, ForAllTyFlag, ForAllTyFlag)]
 pprIfaceForAllCoPart tvs sdoc
   = sep [ pprIfaceForAllCo tvs, sdoc ]
 
+-- XXX JB HERE printing this needs to be fixed
 ppr_iface_forall_part :: ShowForAllFlag
                       -> [IfaceForAllBndr] -> [IfacePredType] -> SDoc -> SDoc
 ppr_iface_forall_part show_forall tvs ctxt sdoc


=====================================
compiler/GHC/Tc/Utils/Unify.hs
=====================================
@@ -410,7 +410,8 @@ matchExpectedFunTys herald ctx arity orig_ty thing_inside
     --     to syntactically visible patterns in the source program
     -- See Note [Visible type application and abstraction] in GHC.Tc.Gen.App
     go acc_arg_tys n ty
-      | Just (eras, Bndr tv vis, ty') <- splitForAllForAllTyBinder_maybe ty
+    -- XXX JB HERE Maybe this should use the tc version of splitForAllTys (and then splitForAllTys can stop removing the function type)
+      | Just (eras, Bndr tv vis, ty') <- tcSplitForAllTyVarBinder_maybe ty
       , Required <- vis
       = let init_subst = mkEmptySubst (mkInScopeSet (tyCoVarsOfType ty))
         in goVdq eras init_subst acc_arg_tys n ty tv ty'



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2f14e085001a9b659b93c2fa7582a67b5d51e57a

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2f14e085001a9b659b93c2fa7582a67b5d51e57a
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230730/18955331/attachment-0001.html>


More information about the ghc-commits mailing list