Commit 113397e4 authored by simonpj's avatar simonpj
Browse files

[project @ 2004-10-08 11:36:26 by simonpj]

Fix missing case for algTyConRhs; fixes test ghci011
parent 2b65c00d
......@@ -53,7 +53,7 @@ import TyCon ( TyCon, ArgVrcs, AlgTyConRhs(..), isRecursiveTyCon, isForeignTyCo
isSynTyCon, isAlgTyCon, isPrimTyCon, isFunTyCon,
isTupleTyCon, tupleTyConBoxity,
tyConHasGenerics, tyConArgVrcs, getSynTyConDefn,
tyConArity, tyConTyVars, algTcRhs, tyConExtName )
tyConArity, tyConTyVars, algTyConRhs, tyConExtName )
import DataCon ( dataConName, dataConSig, dataConFieldLabels, dataConStrictMarks,
dataConTyCon, dataConIsInfix, isVanillaDataCon )
import Class ( FunDep, DefMeth, classExtraBigSig, classTyCon )
......@@ -490,7 +490,7 @@ tyThingToIfaceDecl _ abstract_tcs ext (ATyCon tycon)
| isAlgTyCon tycon
= IfaceData { ifName = getOccName tycon,
ifTyVars = toIfaceTvBndrs tyvars,
ifCons = ifaceConDecls (algTcRhs tycon),
ifCons = ifaceConDecls (algTyConRhs tycon),
ifRec = boolToRecFlag (isRecursiveTyCon tycon),
ifVrcs = tyConArgVrcs tycon,
ifGeneric = tyConHasGenerics tycon }
......
......@@ -45,7 +45,7 @@ import TcRnMonad
import IfaceEnv ( lookupOrig )
import Class ( Class, classBigSig )
import TyCon ( TyCon, AlgTyConRhs(..), tyConTyVars, getSynTyConDefn,
isSynTyCon, isNewTyCon, tyConDataCons, algTcRhs )
isSynTyCon, isNewTyCon, tyConDataCons, algTyConRhs )
import DataCon ( DataCon, dataConTyCon, dataConOrigArgTys, dataConStrictMarks,
dataConName, dataConFieldLabels, dataConWrapId, dataConIsInfix,
isVanillaDataCon )
......@@ -569,7 +569,7 @@ reifyTyCon tc
; return (TH.TySynD (reifyName tc) (reifyTyVars tvs) rhs') }
reifyTyCon tc
= case algTcRhs tc of
= case algTyConRhs tc of
NewTyCon data_con _ _
-> do { con <- reifyDataCon data_con
; return (TH.NewtypeD [] (reifyName tc) (reifyTyVars (tyConTyVars tc))
......
......@@ -33,7 +33,7 @@ module TyCon(
tyConUnique,
tyConTyVars,
tyConArgVrcs,
algTcRhs, tyConDataCons, tyConDataCons_maybe, tyConFamilySize,
algTyConRhs, tyConDataCons, tyConDataCons_maybe, tyConFamilySize,
tyConFields, tyConSelIds,
tyConStupidTheta,
tyConArity,
......@@ -490,6 +490,11 @@ tyConFields other_tycon = []
tyConSelIds :: TyCon -> [Id]
tyConSelIds tc = [id | (_,_,id) <- tyConFields tc]
algTyConRhs :: TyCon -> AlgTyConRhs
algTyConRhs (AlgTyCon {algTcRhs = rhs}) = rhs
algTyConRhs (TupleTyCon {dataCon = con}) = DataTyCon (Just []) [con] False
algTyConRhs other = pprPanic "algTyConRhs" (ppr other)
\end{code}
\begin{code}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment