From c860699ce51ab92e85ee30c6afe555fc345f4c37 Mon Sep 17 00:00:00 2001 From: "simonpj@microsoft.com" Date: Thu, 13 Jul 2006 21:34:18 +0000 Subject: [PATCH] A class in an interface file defines the CoTyCon of its class tyocn --- compiler/iface/LoadIface.lhs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/iface/LoadIface.lhs b/compiler/iface/LoadIface.lhs index c7dac79..3faf00c 100644 --- a/compiler/iface/LoadIface.lhs +++ b/compiler/iface/LoadIface.lhs @@ -338,7 +338,8 @@ ifaceDeclSubBndrs :: IfaceDecl -> [OccName] ifaceDeclSubBndrs IfaceClass { ifCtxt = sc_ctxt, ifName = cls_occ, ifSigs = sigs } - = [tc_occ, dc_occ, dcww_occ] ++ + = co_occs ++ + [tc_occ, dc_occ, dcww_occ] ++ [op | IfaceClassOp op _ _ <- sigs] ++ [mkSuperDictSelOcc n cls_occ | n <- [1..n_ctxt]] where @@ -346,6 +347,8 @@ ifaceDeclSubBndrs IfaceClass { ifCtxt = sc_ctxt, n_sigs = length sigs tc_occ = mkClassTyConOcc cls_occ dc_occ = mkClassDataConOcc cls_occ + co_occs | is_newtype = [mkNewTyCoOcc tc_occ] + | otherwise = [] dcww_occ | is_newtype = mkDataConWrapperOcc dc_occ -- Newtypes have wrapper but no worker | otherwise = mkDataConWorkerOcc dc_occ -- Otherwise worker but no wrapper is_newtype = n_sigs + n_ctxt == 1 -- Sigh -- 1.7.10.4