From 9e9fb57c37c62bb6c90f15b173c5d3632121c66a Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Fri, 28 Jul 2017 18:25:12 -0400 Subject: Fix hs-boot knot-tying with record wild cards. Fixes #13710. Signed-off-by: Edward Z. Yang Test Plan: validate Reviewers: bgamari, austin, simonpj Reviewed By: simonpj Subscribers: simonpj, rwbarton, thomie GHC Trac Issues: #13710 Differential Revision: https://phabricator.haskell.org/D3743 --- compiler/iface/TcIface.hs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'compiler/iface') diff --git a/compiler/iface/TcIface.hs b/compiler/iface/TcIface.hs index b3119b2446..9e0616518f 100644 --- a/compiler/iface/TcIface.hs +++ b/compiler/iface/TcIface.hs @@ -915,7 +915,14 @@ tcIfaceDataCons tycon_name tycon tc_tybinders if_cons ; ~(eq_spec, theta, arg_tys, stricts) <- forkM (mk_doc dc_name) $ do { eq_spec <- tcIfaceEqSpec spec ; theta <- tcIfaceCtxt ctxt - ; arg_tys <- mapM tcIfaceType args + -- This fixes #13710. The enclosing lazy thunk gets + -- forced when typechecking record wildcard pattern + -- matching (it's not completely clear why this + -- tuple is needed), which causes trouble if one of + -- the argument types was recursively defined. + -- See also Note [Tying the knot] + ; arg_tys <- forkM (mk_doc dc_name <+> text "arg_tys") + $ mapM tcIfaceType args ; stricts <- mapM tc_strict if_stricts -- The IfBang field can mention -- the type itself; hence inside forkM -- cgit v1.2.1