Kind checking bugfix (#4356) and preventing wanteds from rewriting wanteds
[ghc-hetmet.git] / compiler / main / HscMain.lhs
index 933503e..0daab4a 100644 (file)
@@ -54,6 +54,7 @@ import DsMeta         ( templateHaskellNames )
 import SrcLoc          ( SrcSpan, noSrcLoc, interactiveSrcLoc, srcLocSpan, noSrcSpan, unLoc )
 import VarSet
 import VarEnv          ( emptyTidyEnv )
+import Panic
 #endif
 
 import Id              ( Id )
@@ -148,9 +149,7 @@ newHscEnv callbacks dflags
                           hsc_FC      = fc_var,
                           hsc_MLC     = mlc_var,
                           hsc_OptFuel = optFuel,
-                           hsc_type_env_var = Nothing,
-                           hsc_global_rdr_env = emptyGlobalRdrEnv,
-                           hsc_global_type_env = emptyNameEnv } ) }
+                           hsc_type_env_var = Nothing } ) }
 
 
 knownKeyNames :: [Name]        -- Put here to avoid loops involving DsMeta,
@@ -1026,6 +1025,11 @@ hscParseThing parser dflags str
 compileExpr :: HscEnv -> SrcSpan -> CoreExpr -> IO HValue
 
 compileExpr hsc_env srcspan ds_expr
+  | rtsIsProfiled
+  = throwIO (InstallationError "You can't call compileExpr in a profiled compiler")
+         -- Otherwise you get a seg-fault when you run it
+
+  | otherwise
   = do { let { dflags  = hsc_dflags hsc_env ;
                lint_on = dopt Opt_DoCoreLinting dflags }