From 93df442a7d16b6a87d3a73166a557ae7953e65f0 Mon Sep 17 00:00:00 2001 From: Krzysztof Gogolewski Date: Sun, 27 Sep 2020 22:03:07 +0200 Subject: Linear types: fix kind inference when checking datacons (cherry picked from b31a3360e2ef12f3ec7eaf66b3600247c1eb36c3) --- compiler/GHC/Tc/TyCl.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/GHC/Tc/TyCl.hs b/compiler/GHC/Tc/TyCl.hs index 4ad0da6292..d62d2cc9db 100644 --- a/compiler/GHC/Tc/TyCl.hs +++ b/compiler/GHC/Tc/TyCl.hs @@ -1563,7 +1563,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 } -- cgit v1.2.1