Commit 6c0d7900 authored by simonpj's avatar simonpj
Browse files

[project @ 2001-08-21 09:59:33 by simonpj]

Fix tycon assert failure
parent 43471ae0
......@@ -29,7 +29,7 @@ import Var ( TyVar )
import Name ( Name, mkWiredInName )
import RdrName ( RdrName, mkRdrOrig )
import OccName ( OccName, pprOccName, mkVarOcc )
import TyCon ( TyCon )
import TyCon ( TyCon, isPrimTyCon, tyConPrimRep )
import Type ( Type, mkForAllTys, mkFunTy, mkFunTys, typePrimRep,
splitFunTy_maybe, tyConAppTyCon, splitTyConApp,
mkUTy, usOnce, usMany
......@@ -517,12 +517,14 @@ data PrimOpResultInfo
getPrimOpResultInfo :: PrimOp -> PrimOpResultInfo
getPrimOpResultInfo op
= case (primOpInfo op) of
Dyadic _ ty -> ReturnsPrim (typePrimRep ty)
Monadic _ ty -> ReturnsPrim (typePrimRep ty)
Compare _ ty -> ReturnsAlg boolTyCon
GenPrimOp _ _ _ ty -> case typePrimRep ty of
PtrRep -> ReturnsAlg (tyConAppTyCon ty)
rep -> ReturnsPrim rep
Dyadic _ ty -> ReturnsPrim (typePrimRep ty)
Monadic _ ty -> ReturnsPrim (typePrimRep ty)
Compare _ ty -> ReturnsAlg boolTyCon
GenPrimOp _ _ _ ty | isPrimTyCon tc -> ReturnsPrim (tyConPrimRep tc)
| otherwise -> ReturnsAlg tc
where
tc = tyConAppTyCon ty
-- All primops return a tycon-app result
\end{code}
The commutable ops are those for which we will try to move constants
......
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