From 6effb9e6c8af3a5b600824d90f0e8e6a44ab18ae Mon Sep 17 00:00:00 2001 From: "simonpj@microsoft.com" Date: Tue, 4 Dec 2007 15:29:03 +0000 Subject: [PATCH] Make HscTypes.tyThingId respond not panic on ADataCon --- compiler/main/HscTypes.lhs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/compiler/main/HscTypes.lhs b/compiler/main/HscTypes.lhs index 0a6ad3d..5e6a33e 100644 --- a/compiler/main/HscTypes.lhs +++ b/compiler/main/HscTypes.lhs @@ -96,7 +96,7 @@ import Type import Class ( Class, classSelIds, classATs, classTyCon ) import TyCon -import DataCon ( DataCon, dataConImplicitIds ) +import DataCon ( DataCon, dataConImplicitIds, dataConWrapId ) import PrelNames ( gHC_PRIM ) import Packages hiding ( Version(..) ) import DynFlags ( DynFlags(..), isOneShot, HscTarget (..) ) @@ -959,8 +959,9 @@ tyThingDataCon (ADataCon dc) = dc tyThingDataCon other = pprPanic "tyThingDataCon" (pprTyThing other) tyThingId :: TyThing -> Id -tyThingId (AnId id) = id -tyThingId other = pprPanic "tyThingId" (pprTyThing other) +tyThingId (AnId id) = id +tyThingId (ADataCon dc) = dataConWrapId dc +tyThingId other = pprPanic "tyThingId" (pprTyThing other) \end{code} %************************************************************************ -- 1.7.10.4