summaryrefslogtreecommitdiff
path: root/compiler/stgSyn
diff options
context:
space:
mode:
authorSimon Marlow <simonmar@microsoft.com>2007-05-07 14:53:50 +0000
committerSimon Marlow <simonmar@microsoft.com>2007-05-07 14:53:50 +0000
commitfd8f8c6a4d1d5a91c0095804a9ada86c42d64141 (patch)
treec3f1e665058db79155e6012eb14235096caab917 /compiler/stgSyn
parentc7addbef67840954ad788434c28b0a3476ee0ad7 (diff)
downloadhaskell-fd8f8c6a4d1d5a91c0095804a9ada86c42d64141.tar.gz
FIX print020: conversion of case expressions of type 'Any' was wrong
All primitive types were getting PrimAlts, where actually case expressions on 'Any' should get a PolyAlt. The result was that seq on Any compiled into a no-op, which caused :force to go into an infinite loop.
Diffstat (limited to 'compiler/stgSyn')
-rw-r--r--compiler/stgSyn/CoreToStg.lhs5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/stgSyn/CoreToStg.lhs b/compiler/stgSyn/CoreToStg.lhs
index 994b900960..614feba45d 100644
--- a/compiler/stgSyn/CoreToStg.lhs
+++ b/compiler/stgSyn/CoreToStg.lhs
@@ -16,7 +16,7 @@ import CoreUtils ( rhsIsStatic, manifestArity, exprType, findDefault )
import StgSyn
import Type
-import TyCon ( isAlgTyCon )
+import TyCon
import Id
import Var ( Var, globalIdDetails, idType )
import TyCon ( isUnboxedTupleTyCon, isPrimTyCon, isFunTyCon, isHiBootTyCon )
@@ -410,10 +410,11 @@ coreToStgExpr (Let bind body)
mkStgAltType scrut_ty alts
= case splitTyConApp_maybe (repType scrut_ty) of
Just (tc,_) | isUnboxedTupleTyCon tc -> UbxTupAlt tc
- | isPrimTyCon tc -> PrimAlt tc
+ | isUnLiftedTyCon tc -> PrimAlt tc
| isHiBootTyCon tc -> look_for_better_tycon
| isAlgTyCon tc -> AlgAlt tc
| isFunTyCon tc -> PolyAlt
+ | isPrimTyCon tc -> PolyAlt -- for "Any"
| otherwise -> pprPanic "mkStgAlts" (ppr tc)
Nothing -> PolyAlt