projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
942fd04
)
Make HscTypes.tyThingId respond not panic on ADataCon
author
simonpj@microsoft.com
<unknown>
Tue, 4 Dec 2007 15:29:03 +0000
(15:29 +0000)
committer
simonpj@microsoft.com
<unknown>
Tue, 4 Dec 2007 15:29:03 +0000
(15:29 +0000)
compiler/main/HscTypes.lhs
patch
|
blob
|
history
diff --git
a/compiler/main/HscTypes.lhs
b/compiler/main/HscTypes.lhs
index
0a6ad3d
..
5e6a33e
100644
(file)
--- 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 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 (..) )
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
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}
%************************************************************************
\end{code}
%************************************************************************