Commit 6129c42a authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Add test for Trac #1678, and update output for TH_exn2

parent 58578081
TH_exn2.hs:1:0:
Exception when trying to interpret result of compile-time code:
Exception when trying to run compile-time code:
Prelude.tail: empty list
Code: let
>>= = (>>=) @ Language.Haskell.TH.Syntax.Q $dMonad
......
{-# OPTIONS -fth #-}
-- See Trac #1678
module TH where
import Language.Haskell.TH
-- foo = $(fail "hi")
foo = $(runIO (fail "hi"))
TH_runIO.hs:12:8:
Exception when trying to run compile-time code:
user error (hi)
Code: let
fail = fail @ IO $dMonad
$dMonad = GHC.IOBase.$f16
in runIO @ Exp (fail @ Exp "hi")
In the expression: $[splice](runIO (fail "hi"))
In the definition of `foo': foo = $[splice](runIO (fail "hi"))
......@@ -76,3 +76,4 @@ test('TH_dataD1', normal, compile_fail, ['-v0'])
test('TH_ppr1', normal, compile_and_run, ['-fglasgow-exts'])
test('TH_fail', normal, compile_fail, ['-v0'])
test('TH_runIO', normal, compile_fail, ['-v0'])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment