Panic in the right way
authorsimonpj@microsoft.com <unknown>
Wed, 25 Aug 2010 09:16:14 +0000 (09:16 +0000)
committersimonpj@microsoft.com <unknown>
Wed, 25 Aug 2010 09:16:14 +0000 (09:16 +0000)
compiler/main/HscMain.lhs

index 3ab10a4..93ad614 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 )
@@ -1027,7 +1028,7 @@ compileExpr :: HscEnv -> SrcSpan -> CoreExpr -> IO HValue
 
 compileExpr hsc_env srcspan ds_expr
   | rtsIsProfiled
-  = panic "You can't call compileExpr in a profiled compiler"
+  = throwIO (InstallationError "You can't call compileExpr in a profiled compiler")
          -- Otherwise you get a seg-fault when you run it
 
   | otherwise