Fix a bug in RtClosureInspect.cvReconstructType.
[ghc-hetmet.git] / compiler / ghci / RtClosureInspect.hs
index cafa527..dbc65d2 100644 (file)
@@ -11,6 +11,9 @@ module RtClosureInspect(
      cvObtainTerm,      -- :: HscEnv -> Int -> Bool -> Maybe Type -> HValue -> IO Term
 
      Term(..),
+     isTerm,
+     isSuspension,
+     isPrim,
      pprTerm, 
      cPprTerm, 
      cPprTermBase,
@@ -27,7 +30,12 @@ module RtClosureInspect(
 --     unsafeDeepSeq, 
      cvReconstructType,
      computeRTTIsubst, 
-     sigmaType
+     sigmaType,
+     Closure(..),
+     getClosureData,
+     ClosureType(..),
+     isConstr,
+     isIndirection
  ) where 
 
 #include "HsVersions.h"
@@ -39,7 +47,7 @@ import Linker
 
 import DataCon          
 import Type             
-import TcRnMonad        ( TcM, initTc, initTcPrintErrors, ioToTcRn, 
+import TcRnMonad        ( TcM, initTc, ioToTcRn, 
                           tryTcErrs)
 import TcType
 import TcMType
@@ -69,7 +77,6 @@ import Control.Monad
 import Data.Maybe
 import Data.Array.Base
 import Data.List        ( partition )
-import qualified Data.Sequence as Seq
 import Foreign
 import System.IO.Unsafe
 
@@ -633,7 +640,8 @@ cvReconstructType hsc_env force mb_ty hval = runTR_maybe hsc_env $ do
             (signatureType,_) <- instScheme(dataConRepType dc) 
             addConstraint myType signatureType
             return $ [ appArr (\e->(t,e)) (ptrs clos) i
-                       | (i,t) <- drop extra_args $ zip [0..] subTtypes]
+                       | (i,t) <- drop extra_args $ 
+                                     zip [0..] (filter isPointed subTtypes)]
       otherwise -> return []
 
      -- This helper computes the difference between a base type t and the