diff options
author | Edward Z. Yang <ezyang@cs.stanford.edu> | 2017-07-20 11:30:46 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-07-20 11:30:47 -0400 |
commit | fdb6a5bfd545094782fb539951b561ac2467443d (patch) | |
tree | 330835eaae8d987cb96dd8bde8a1fd7926a44508 /compiler/iface/TcIface.hs | |
parent | 194384f1318e0553e0c5ce621ca0903b55862eb3 (diff) | |
download | haskell-fdb6a5bfd545094782fb539951b561ac2467443d.tar.gz |
Make IfaceAxiom typechecking lazier.
Fixes #13803, but adds a note about a yet to be fixed #13981.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: bgamari, austin
Reviewed By: bgamari
Subscribers: simonpj, rwbarton, thomie
GHC Trac Issues: #13803
Differential Revision: https://phabricator.haskell.org/D3742
Diffstat (limited to 'compiler/iface/TcIface.hs')
-rw-r--r-- | compiler/iface/TcIface.hs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/compiler/iface/TcIface.hs b/compiler/iface/TcIface.hs index 3a6a4070d2..1477f462fc 100644 --- a/compiler/iface/TcIface.hs +++ b/compiler/iface/TcIface.hs @@ -807,7 +807,14 @@ tc_iface_decl _parent ignore_prags tc_iface_decl _ _ (IfaceAxiom { ifName = tc_name, ifTyCon = tc , ifAxBranches = branches, ifRole = role }) = do { tc_tycon <- tcIfaceTyCon tc - ; tc_branches <- tc_ax_branches branches + -- Must be done lazily, because axioms are forced when checking + -- for family instance consistency, and the RHS may mention + -- a hs-boot declared type constructor that is going to be + -- defined by this module. + -- e.g. type instance F Int = ToBeDefined + -- See Trac #13803 + ; tc_branches <- forkM (text "Axiom branches" <+> ppr tc_name) + $ tc_ax_branches branches ; let axiom = CoAxiom { co_ax_unique = nameUnique tc_name , co_ax_name = tc_name , co_ax_tc = tc_tycon |