Skip to content
Snippets Groups Projects
Commit 700d8007 authored by Simon Marlow's avatar Simon Marlow
Browse files

[project @ 1998-12-22 18:03:27 by simonm]

Another fix for getScrutineeTyCon: ignore Fun tycons.
parent 6c47942e
No related merge requests found
%
% (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
%
% $Id: CgCase.lhs,v 1.20 1998/12/22 12:55:54 simonm Exp $
% $Id: CgCase.lhs,v 1.21 1998/12/22 18:03:27 simonm Exp $
%
%********************************************************
%* *
......@@ -59,7 +59,7 @@ import PrimOp ( primOpOutOfLine, PrimOp(..) )
import PrimRep ( getPrimRepSize, retPrimRepSize, PrimRep(..)
)
import TyCon ( TyCon, isEnumerationTyCon, isUnboxedTupleTyCon,
isNewTyCon, isAlgTyCon,
isNewTyCon, isAlgTyCon, isFunTyCon, isPrimTyCon,
tyConDataCons, tyConFamilySize )
import Type ( Type, typePrimRep, splitAlgTyConApp, splitTyConApp_maybe,
splitFunTys, applyTys )
......@@ -1013,8 +1013,9 @@ getScrutineeTyCon ty =
case (splitTyConAppThroughNewTypes ty) of
Nothing -> Nothing
Just (tc,_) ->
if not (isAlgTyCon tc) then Just tc else
-- works for primitive TyCons too
if isFunTyCon tc then Nothing else -- not interested in funs
if isPrimTyCon tc then Just tc else -- return primitive tycons
-- otherwise (algebraic tycons) check the no. of constructors
case (tyConFamilySize tc) of
0 -> pprTrace "Warning" (hcat [
text "constructors for ",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment