summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compiler/GHC/Tc/TyCl.hs4
-rw-r--r--testsuite/tests/linear/should_compile/MultConstructor.hs2
2 files changed, 4 insertions, 2 deletions
diff --git a/compiler/GHC/Tc/TyCl.hs b/compiler/GHC/Tc/TyCl.hs
index 9cd0b2a66c..9335eb1d58 100644
--- a/compiler/GHC/Tc/TyCl.hs
+++ b/compiler/GHC/Tc/TyCl.hs
@@ -1569,7 +1569,9 @@ kcTyClDecl (FamDecl _ (FamilyDecl { fdInfo = fd_info })) fam_tc
kcConArgTys :: NewOrData -> Kind -> [HsScaled GhcRn (LHsType GhcRn)] -> TcM ()
kcConArgTys new_or_data res_kind arg_tys = do
{ let exp_kind = getArgExpKind new_or_data res_kind
- ; mapM_ (flip tcCheckLHsType exp_kind . getBangType . hsScaledThing) arg_tys
+ ; forM_ arg_tys (\(HsScaled mult ty) -> do tcCheckLHsType (getBangType ty) exp_kind
+ tcMult mult)
+
-- See Note [Implementation of UnliftedNewtypes], STEP 2
}
diff --git a/testsuite/tests/linear/should_compile/MultConstructor.hs b/testsuite/tests/linear/should_compile/MultConstructor.hs
index a97eade18e..780c906099 100644
--- a/testsuite/tests/linear/should_compile/MultConstructor.hs
+++ b/testsuite/tests/linear/should_compile/MultConstructor.hs
@@ -3,7 +3,7 @@ module MultConstructor where
import GHC.Types
-data T (p :: Multiplicity) a where
+data T p a where
MkT :: a %p -> T p a
{-