summaryrefslogtreecommitdiff
path: root/compiler/GHC/Core/Opt/Arity.hs
diff options
context:
space:
mode:
authorSebastian Graf <sebastian.graf@kit.edu>2022-04-02 20:11:34 +0200
committerSebastian Graf <sebastian.graf@kit.edu>2022-04-02 20:11:34 +0200
commit913492c021fc49752137e202bba154c9bd20035e (patch)
tree8667871ade4c833996bbc443d681af2bd5e37b11 /compiler/GHC/Core/Opt/Arity.hs
parent058e3d6b2df1e6bc9dfd0c476e09bb8112cd44cd (diff)
downloadhaskell-wip/T21229.tar.gz
Diffstat (limited to 'compiler/GHC/Core/Opt/Arity.hs')
-rw-r--r--compiler/GHC/Core/Opt/Arity.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/GHC/Core/Opt/Arity.hs b/compiler/GHC/Core/Opt/Arity.hs
index ab38be413c..9e2bfe1efd 100644
--- a/compiler/GHC/Core/Opt/Arity.hs
+++ b/compiler/GHC/Core/Opt/Arity.hs
@@ -37,7 +37,7 @@ import GHC.Core
import GHC.Core.FVs
import GHC.Core.Utils
import GHC.Core.DataCon
-import GHC.Core.TyCon ( tyConArity )
+import GHC.Core.TyCon
import GHC.Core.TyCon.RecWalk ( initRecTc, checkRecTc )
import GHC.Core.Predicate ( isDictTy, isCallStackPredTy )
import GHC.Core.Multiplicity
@@ -1812,7 +1812,8 @@ pushCoDataCon dc dc_args co
-- where S is a type function. In fact, exprIsConApp
-- will probably not be called in such circumstances,
-- but there's nothing wrong with it
-
+ , not (isNewDataCon dc) || isClassTyCon to_tc
+ -- see Note [NthCo and newtypes] in GHC.Core.TyCo.Rep
= let
tc_arity = tyConArity to_tc
dc_univ_tyvars = dataConUnivTyVars dc