[project @ 2002-04-13 15:02:35 by panne]
authorpanne <unknown>
Sat, 13 Apr 2002 15:02:35 +0000 (15:02 +0000)
committerpanne <unknown>
Sat, 13 Apr 2002 15:02:35 +0000 (15:02 +0000)
Dirty workaround for a strange error after bootstrapping:

   stgSyn/CoreToStg.lhs:1112:
       Couldn't match `#' against `*'
       When matching types `GHC.Prim.Int#' and `a'
   Expected type: GHC.Prim.Int#
           Inferred type: a
   In the application `error ("cafRefs " ++ (showSDoc (ppr id)))'

Should be fixed elsewhere, but I don't know how... :-}

ghc/compiler/stgSyn/CoreToStg.lhs

index 1db8794..1962edf 100644 (file)
@@ -1108,7 +1108,9 @@ cafRefs p (Var id)
        Just (LetBound (TopLet caf_info) _) -> fastBool (mayHaveCafRefs caf_info)
         Nothing | isGlobalId id                    -> fastBool (mayHaveCafRefs (idCafInfo id)) -- Imported
                | otherwise                 -> fastBool False                           -- Nested binder
-       _other                              -> error ("cafRefs " ++ showSDoc (ppr id))  -- No nested things in env
+       -- NOTE: The 'fastBool' below is a (temporary?) workaround for a
+       -- strange bug in GHC. It's strict in its argument, so who cares...? :-}
+       _other                              -> fastBool (error ("cafRefs " ++ showSDoc (ppr id)))       -- No nested things in env
 
 cafRefs p (Lit l)           = fastBool False
 cafRefs p (App f a)         = fastOr (cafRefs p f) (cafRefs p) a