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 ...@@ -53,7 +53,7 @@ import TyCon ( TyCon, ArgVrcs, AlgTyConRhs(..), isRecursiveTyCon, isForeignTyCo
isSynTyCon, isAlgTyCon, isPrimTyCon, isFunTyCon, isSynTyCon, isAlgTyCon, isPrimTyCon, isFunTyCon,
isTupleTyCon, tupleTyConBoxity, isTupleTyCon, tupleTyConBoxity,
tyConHasGenerics, tyConArgVrcs, getSynTyConDefn, tyConHasGenerics, tyConArgVrcs, getSynTyConDefn,
tyConArity, tyConTyVars, algTcRhs, tyConExtName ) tyConArity, tyConTyVars, algTyConRhs, tyConExtName )
import DataCon ( dataConName, dataConSig, dataConFieldLabels, dataConStrictMarks, import DataCon ( dataConName, dataConSig, dataConFieldLabels, dataConStrictMarks,
dataConTyCon, dataConIsInfix, isVanillaDataCon ) dataConTyCon, dataConIsInfix, isVanillaDataCon )
import Class ( FunDep, DefMeth, classExtraBigSig, classTyCon ) import Class ( FunDep, DefMeth, classExtraBigSig, classTyCon )
...@@ -490,7 +490,7 @@ tyThingToIfaceDecl _ abstract_tcs ext (ATyCon tycon) ...@@ -490,7 +490,7 @@ tyThingToIfaceDecl _ abstract_tcs ext (ATyCon tycon)
| isAlgTyCon tycon | isAlgTyCon tycon
= IfaceData { ifName = getOccName tycon, = IfaceData { ifName = getOccName tycon,
ifTyVars = toIfaceTvBndrs tyvars, ifTyVars = toIfaceTvBndrs tyvars,
ifCons = ifaceConDecls (algTcRhs tycon), ifCons = ifaceConDecls (algTyConRhs tycon),
ifRec = boolToRecFlag (isRecursiveTyCon tycon), ifRec = boolToRecFlag (isRecursiveTyCon tycon),
ifVrcs = tyConArgVrcs tycon, ifVrcs = tyConArgVrcs tycon,
ifGeneric = tyConHasGenerics tycon } ifGeneric = tyConHasGenerics tycon }
......
...@@ -45,7 +45,7 @@ import TcRnMonad ...@@ -45,7 +45,7 @@ import TcRnMonad
import IfaceEnv ( lookupOrig ) import IfaceEnv ( lookupOrig )
import Class ( Class, classBigSig ) import Class ( Class, classBigSig )
import TyCon ( TyCon, AlgTyConRhs(..), tyConTyVars, getSynTyConDefn, import TyCon ( TyCon, AlgTyConRhs(..), tyConTyVars, getSynTyConDefn,
isSynTyCon, isNewTyCon, tyConDataCons, algTcRhs ) isSynTyCon, isNewTyCon, tyConDataCons, algTyConRhs )
import DataCon ( DataCon, dataConTyCon, dataConOrigArgTys, dataConStrictMarks, import DataCon ( DataCon, dataConTyCon, dataConOrigArgTys, dataConStrictMarks,
dataConName, dataConFieldLabels, dataConWrapId, dataConIsInfix, dataConName, dataConFieldLabels, dataConWrapId, dataConIsInfix,
isVanillaDataCon ) isVanillaDataCon )
...@@ -569,7 +569,7 @@ reifyTyCon tc ...@@ -569,7 +569,7 @@ reifyTyCon tc
; return (TH.TySynD (reifyName tc) (reifyTyVars tvs) rhs') } ; return (TH.TySynD (reifyName tc) (reifyTyVars tvs) rhs') }
reifyTyCon tc reifyTyCon tc
= case algTcRhs tc of = case algTyConRhs tc of
NewTyCon data_con _ _ NewTyCon data_con _ _
-> do { con <- reifyDataCon data_con -> do { con <- reifyDataCon data_con
; return (TH.NewtypeD [] (reifyName tc) (reifyTyVars (tyConTyVars tc)) ; return (TH.NewtypeD [] (reifyName tc) (reifyTyVars (tyConTyVars tc))
......
...@@ -33,7 +33,7 @@ module TyCon( ...@@ -33,7 +33,7 @@ module TyCon(
tyConUnique, tyConUnique,
tyConTyVars, tyConTyVars,
tyConArgVrcs, tyConArgVrcs,
algTcRhs, tyConDataCons, tyConDataCons_maybe, tyConFamilySize, algTyConRhs, tyConDataCons, tyConDataCons_maybe, tyConFamilySize,
tyConFields, tyConSelIds, tyConFields, tyConSelIds,
tyConStupidTheta, tyConStupidTheta,
tyConArity, tyConArity,
...@@ -490,6 +490,11 @@ tyConFields other_tycon = [] ...@@ -490,6 +490,11 @@ tyConFields other_tycon = []
tyConSelIds :: TyCon -> [Id] tyConSelIds :: TyCon -> [Id]
tyConSelIds tc = [id | (_,_,id) <- tyConFields tc] 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} \end{code}
\begin{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