- ioToTcRn (HscMain.compileExpr hsc_env pcs this_mod
- print_unqual expr) `thenM` \ hval ->
-
- tryM (tcRunQ (unsafeCoerce# hval)) `thenM` \ either_tval ->
+ -- Wrap the compile-and-run in an exception-catcher
+ -- Compiling might fail if linking fails
+ -- Running might fail if it throws an exception
+ tryM (ioToTcRn (do
+ hval <- HscMain.compileExpr
+ hsc_env pcs this_mod
+ rdr_env type_env expr
+ Meta.runQ (unsafeCoerce# hval) -- Coerce it to Q t, and run it
+ )) `thenM` \ either_tval ->