[Git][ghc/ghc][wip/T23109] Allow pushDataCon on ClassTyCon newtypes

Simon Peyton Jones (@simonpj) gitlab at gitlab.haskell.org
Thu Apr 18 15:26:35 UTC 2024



Simon Peyton Jones pushed to branch wip/T23109 at Glasgow Haskell Compiler / GHC


Commits:
45c567cd by Simon Peyton Jones at 2024-04-18T16:24:35+01:00
Allow pushDataCon on ClassTyCon newtypes

The fact that there is no *actual* data constructor in the end i
kind-of-irrelevant, and we turn out to get quite a lot of
     class-op (d |> co)
where co : C t1 ~R C t2

- - - - -


1 changed file:

- compiler/GHC/Core/Opt/Arity.hs


Changes:

=====================================
compiler/GHC/Core/Opt/Arity.hs
=====================================
@@ -3065,6 +3065,8 @@ push_dc_gen dc dc_args co (Pair from_ty to_ty)
         -- where S is a type function.  In fact, exprIsConApp
         -- will probably not be called in such circumstances,
         -- but there's nothing wrong with it
+  = Just (push_data_con to_tc to_tc_arg_tys dc dc_args co Representational)
+{-
   = case isSubCo_maybe co of
       Just co' -> Just (push_data_con to_tc to_tc_arg_tys dc dc_args co' Nominal)
       _        | isInjectiveTyCon to_tc Representational
@@ -3076,6 +3078,7 @@ push_dc_gen dc dc_args co (Pair from_ty to_ty)
 --                            , text "of type:" <+> ppr (coercionType co)
                             , text "role:" <+> ppr (coercionRole co) ])
                   Nothing
+-}
 
   | otherwise
   = Nothing



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/45c567cde6ccc0d22a706a427089c157add1949b

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/45c567cde6ccc0d22a706a427089c157add1949b
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/20240418/7a4be4b7/attachment.html>


More information about the ghc-commits mailing list