[Git][ghc/ghc][wip/T23923-mikolaj-take-2] Try sequence LintM actions strictly

Mikolaj Konarski (@Mikolaj) gitlab at gitlab.haskell.org
Tue Mar 5 20:17:33 UTC 2024



Mikolaj Konarski pushed to branch wip/T23923-mikolaj-take-2 at Glasgow Haskell Compiler / GHC


Commits:
dc77120b by Mikolaj Konarski at 2024-03-05T21:17:12+01:00
Try sequence LintM actions strictly

- - - - -


1 changed file:

- compiler/GHC/Core/Lint.hs


Changes:

=====================================
compiler/GHC/Core/Lint.hs
=====================================
@@ -1950,14 +1950,15 @@ lintType (TyVarTy tv)
 
   | otherwise
   = do { subst <- getSubst
-       ; case lookupTyVar subst tv of
-           Just linted_ty -> return linted_ty
-
-           -- In GHCi we may lint an expression with a free
-           -- type variable.  Then it won't be in the
-           -- substitution, but it should be in scope
-           Nothing -> do { checkTyCoVarInScope subst tv
-                         ; return (TyVarTy tv) }
+       ; let !f = unLintM $ case lookupTyVar subst tv of
+               Just linted_ty -> return linted_ty
+
+               -- In GHCi we may lint an expression with a free
+               -- type variable.  Then it won't be in the
+               -- substitution, but it should be in scope
+               Nothing -> do { checkTyCoVarInScope subst tv
+                             ; return (TyVarTy tv) }
+       ; LintM f
      }
 
 lintType ty@(AppTy t1 t2)
@@ -2327,10 +2328,11 @@ lintCoercion (CoVarCo cv)
 
   | otherwise
   = do { subst <- getSubst
-       ; case lookupCoVar subst cv of
-           Just linted_co -> return linted_co ;
-           Nothing        -> do { checkTyCoVarInScope subst cv
-                                ; return (CoVarCo cv) }
+       ; let !f = unLintM $ case lookupCoVar subst cv of
+               Just linted_co -> return linted_co ;
+               Nothing        -> do { checkTyCoVarInScope subst cv
+                                    ; return (CoVarCo cv) }
+       ; LintM f
      }
 
 



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

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/dc77120b0d214626e6dbaab64904ddc96793108b
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/20240305/7b963f8d/attachment-0001.html>


More information about the ghc-commits mailing list