From 700d80075ccb6d93d4869154ddb5f3ea4dd34734 Mon Sep 17 00:00:00 2001
From: simonm <unknown>
Date: Tue, 22 Dec 1998 18:03:27 +0000
Subject: [PATCH] [project @ 1998-12-22 18:03:27 by simonm] Another fix for
 getScrutineeTyCon: ignore Fun tycons.

---
 ghc/compiler/codeGen/CgCase.lhs | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/ghc/compiler/codeGen/CgCase.lhs b/ghc/compiler/codeGen/CgCase.lhs
index 4f54e3479076..b1c0b36a67bf 100644
--- a/ghc/compiler/codeGen/CgCase.lhs
+++ b/ghc/compiler/codeGen/CgCase.lhs
@@ -1,7 +1,7 @@
 %
 % (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 ",
-- 
GitLab