[project @ 2004-01-12 12:13:26 by simonpj]
[ghc-hetmet.git] / ghc / compiler / stgSyn / CoreToStg.lhs
index 3291c0d..2f59489 100644 (file)
@@ -18,8 +18,8 @@ import StgSyn
 import Type
 import TyCon           ( isAlgTyCon )
 import Id
-import Var             ( Var, globalIdDetails, varType )
-import TyCon           ( isUnboxedTupleTyCon, isPrimTyCon, isFunTyCon )
+import Var             ( Var, globalIdDetails, idType )
+import TyCon           ( isUnboxedTupleTyCon, isPrimTyCon, isFunTyCon, isHiBootTyCon )
 #ifdef ILX
 import MkId            ( unsafeCoerceId )
 #endif
@@ -411,7 +411,8 @@ mkStgAltType scrut_ty
   = case splitTyConApp_maybe (repType scrut_ty) of
        Just (tc,_) | isUnboxedTupleTyCon tc -> UbxTupAlt tc
                    | isPrimTyCon tc         -> PrimAlt tc
-                   | isAlgTyCon tc          -> AlgAlt tc
+                   | isHiBootTyCon tc       -> PolyAlt -- Algebraic, but no constructors visible
+                   | isAlgTyCon tc          -> AlgAlt tc
                    | isFunTyCon tc          -> PolyAlt
                    | otherwise              -> pprPanic "mkStgAlts" (ppr tc)
        Nothing                              -> PolyAlt
@@ -445,7 +446,7 @@ coreToStgApp maybe_thunk_body f args
             -- Here the free variables are "f", "x" AND the type variable "a"
             -- coreToStgArgs will deal with the arguments recursively
             if opt_RuntimeTypes then
-             fvs `unionFVInfo` tyvarFVInfo (tyVarsOfType (varType f))
+             fvs `unionFVInfo` tyvarFVInfo (tyVarsOfType (idType f))
            else fvs
 
        -- Mostly, the arity info of a function is in the fn's IdInfo