[Git][ghc/ghc][wip/test-frr-zonk2] Test if checkFRR is ever given a constraint

Krzysztof Gogolewski (@monoidal) gitlab at gitlab.haskell.org
Thu Sep 21 19:34:04 UTC 2023



Krzysztof Gogolewski pushed to branch wip/test-frr-zonk2 at Glasgow Haskell Compiler / GHC


Commits:
48cdf6e6 by Krzysztof Gogolewski at 2023-09-21T21:33:56+02:00
Test if checkFRR is ever given a constraint

- - - - -


1 changed file:

- compiler/GHC/Tc/Utils/Concrete.hs


Changes:

=====================================
compiler/GHC/Tc/Utils/Concrete.hs
=====================================
@@ -35,7 +35,7 @@ import GHC.Tc.Utils.TcType
 import GHC.Tc.Utils.TcMType
 import GHC.Tc.Zonk.TcType
 
-import GHC.Types.Basic         ( TypeOrKind(KindLevel) )
+import GHC.Types.Basic         ( TypeOrKind(KindLevel), TypeOrConstraint(..) )
 import GHC.Types.Id
 import GHC.Types.Id.Info
 import GHC.Types.Name
@@ -453,8 +453,10 @@ checkFRR_with check_kind frr_ctxt ty
   = do { th_stage <- getStage
        ; ty <- liftZonkM $ zonkTcType ty
        ; case sORTKind_maybe (typeKind ty) of
-           Just _ -> return ()
-           Nothing -> pprPanic "hasFixedRuntimeRep" (ppr ty $$ ppr (typeKind ty))
+           Just (TypeLike, _) -> return ()
+           Just (ConstraintLike, _) -> pprPanic "hasFixedRuntimeRep: constraint" (ppr ty $$ ppr (typeKind ty))
+
+           Nothing -> return ()
        ; if
           -- Shortcut: check for 'Type' and 'UnliftedType' type synonyms.
           | TyConApp tc [] <- ki



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/48cdf6e6daafbb631530602d459223cb6ab1b540

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/48cdf6e6daafbb631530602d459223cb6ab1b540
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/20230921/5b066680/attachment-0001.html>


More information about the ghc-commits mailing list