diff options
author | Sebastian Graf <sebastian.graf@kit.edu> | 2020-09-29 18:19:53 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-09-30 02:50:54 -0400 |
commit | 395498260ab444f5e1ec82d716bea3cc3ad887f7 (patch) | |
tree | 5d14bb423d393dadf9fd2cee751d0b1b33219fcd | |
parent | 7c98699f685d8c53fd594b6de22b425ed951174f (diff) | |
download | haskell-395498260ab444f5e1ec82d716bea3cc3ad887f7.tar.gz |
Pmc: Don't call exprType on type arguments (#18767)
Fixes #18767.
-rw-r--r-- | compiler/GHC/HsToCore/Pmc/Solver/Types.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/GHC/HsToCore/Pmc/Solver/Types.hs b/compiler/GHC/HsToCore/Pmc/Solver/Types.hs index f6fea1fbbf..4f92703764 100644 --- a/compiler/GHC/HsToCore/Pmc/Solver/Types.hs +++ b/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 |