Require a bang pattern when unlifted types are where/let bound; #3182
[ghc-hetmet.git] / compiler / ghci / ByteCodeLink.lhs
index 63dd7a4..5e39fde 100644 (file)
@@ -42,7 +42,6 @@ import GHC.Word               ( Word(..) )
 import Data.Array.Base
 import GHC.Arr         ( STArray(..) )
 
-import Control.Exception ( throwDyn )
 import Control.Monad   ( zipWithM )
 import Control.Monad.ST ( stToIO )
 
@@ -121,13 +120,13 @@ linkBCO' ie ce (UnlinkedBCO nm arity insns_barr bitmap literalsSS ptrsSS)
        ptrs_arr <- mkPtrsArray ie ce n_ptrs ptrs
 
         let 
-            ptrs_parr = case ptrs_arr of Array _lo _hi _n parr -> parr
+            !ptrs_parr = case ptrs_arr of Array _lo _hi _n parr -> parr
 
             literals_arr = listArray (0, n_literals-1) linked_literals
                            :: UArray Int Word
-            literals_barr = case literals_arr of UArray _lo _hi _n barr -> barr
+            !literals_barr = case literals_arr of UArray _lo _hi _n barr -> barr
 
-           (I# arity#)  = arity
+           !(I# arity#)  = arity
 
         newBCO insns_barr literals_barr ptrs_parr arity# bitmap
 
@@ -245,7 +244,7 @@ lookupIE ie con_nm
 
 linkFail :: String -> String -> IO a
 linkFail who what
-   = throwDyn (ProgramError $
+   = ghcError (ProgramError $
         unlines [ ""
                , "During interactive linking, GHCi couldn't find the following symbol:"
                , ' ' : ' ' : what 
@@ -266,7 +265,7 @@ nameToCLabel n suffix
         else qual_name
   where
         pkgid = modulePackageId mod
-        mod = nameModule n
+        mod = ASSERT( isExternalName n ) nameModule n
         package_part = unpackFS (zEncodeFS (packageIdFS (modulePackageId mod)))
         module_part  = unpackFS (zEncodeFS (moduleNameFS (moduleName mod)))
         occ_part     = unpackFS (zEncodeFS (occNameFS (nameOccName n)))