summaryrefslogtreecommitdiff
path: root/compiler/iface
diff options
context:
space:
mode:
authorEdward Z. Yang <ezyang@cs.stanford.edu>2017-07-28 18:25:12 -0400
committerBen Gamari <ben@smart-cactus.org>2017-07-28 18:25:13 -0400
commit9e9fb57c37c62bb6c90f15b173c5d3632121c66a (patch)
tree1311492c2ac4cfa534801939538bd0430068baff /compiler/iface
parent121fee99496d5f5d53a8cd6b08c13a0b6bb9069d (diff)
downloadhaskell-9e9fb57c37c62bb6c90f15b173c5d3632121c66a.tar.gz
Fix hs-boot knot-tying with record wild cards.
Fixes #13710. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> 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
Diffstat (limited to 'compiler/iface')
-rw-r--r--compiler/iface/TcIface.hs9
1 files changed, 8 insertions, 1 deletions
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