Commit 852ad49c authored by simonpj's avatar simonpj
Browse files

[project @ 2005-11-12 21:38:34 by simonpj]

Add exception test
parent db4868cc
{-# OPTIONS -fth #-}
-- This one generates an exception in the TH
-- code which should be caught in a civilised way
module TH where
$( [d| |] >>= return.tail)
TH_exn.hs:1:0:
Exception when trying to run compile-time code:
Prelude.tail: empty list
Code: let
>>= = (>>=) Language.Haskell.TH.Syntax.Q $dMonad
$dMonad = $dMonad
return = return Language.Haskell.TH.Syntax.Q $dMonad
$dMonad = Language.Haskell.TH.Syntax.$f18
in
(>>=)
[[Language.Haskell.TH.Syntax.Dec],
[Language.Haskell.TH.Syntax.Dec]]
[d| |]
((.) [[Language.Haskell.TH.Syntax.Dec],
Language.Haskell.TH.Syntax.Q [Language.Haskell.TH.Syntax.Dec],
[Language.Haskell.TH.Syntax.Dec]]
(return [Language.Haskell.TH.Syntax.Dec])
(tail Language.Haskell.TH.Syntax.Dec))
Loading package base-1.0 ... linking ... done.
Loading package haskell98-1.0 ... linking ... done.
Loading package template-haskell-1.0 ... linking ... done.
......@@ -51,3 +51,4 @@ test('TH_spliceInst', normal, compile, [''])
test('TH_fail', normal, compile_fail, [''])
test('TH_dupdecl', normal, compile_fail, [''])
test('TH_exn', normal, compile_fail, [''])
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