[Git][ghc/ghc][wip/T18767] Pmc: Don't call exprType on type arguments (#18767)

Sebastian Graf gitlab at gitlab.haskell.org
Tue Sep 29 16:33:51 UTC 2020



Sebastian Graf pushed to branch wip/T18767 at Glasgow Haskell Compiler / GHC


Commits:
7810d130 by Sebastian Graf at 2020-09-29T18:33:41+02:00
Pmc: Don't call exprType on type arguments (#18767)

Fixes #18767.

- - - - -


1 changed file:

- compiler/GHC/HsToCore/Pmc/Solver/Types.hs


Changes:

=====================================
compiler/GHC/HsToCore/Pmc/Solver/Types.hs
=====================================
@@ -62,6 +62,7 @@ import GHC.Builtin.Names
 import GHC.Builtin.Types
 import GHC.Builtin.Types.Prim
 import GHC.Tc.Solver.Monad (InertSet, emptyInert)
+import GHC.Tc.Utils.TcType (isStringTy)
 import GHC.Driver.Types (ConLikeSet)
 
 import Numeric (fromRat)
@@ -562,7 +563,7 @@ coreExprAsPmLit e = case collectArgs e of
   (Var x, args)
     | is_rebound_name x fromStringName
     -- See Note [Detecting overloaded literals with -XRebindableSyntax]
-    , s:_ <- filter (eqType stringTy . exprType) args
+    , s:_ <- filter (isStringTy . exprType) $ filter isValArg args
     -- NB: Calls coreExprAsPmLit and then overloadPmLit, so that we return PmLitOverStrings
     -> coreExprAsPmLit s >>= overloadPmLit (exprType e)
   -- These last two cases handle proper String literals



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

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7810d1307498e0ee2bf8f28e18220203cd775b2a
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/20200929/7556f11d/attachment.html>


More information about the ghc-commits mailing list