Commit 95e199e4 authored by Simon Peyton Jones's avatar Simon Peyton Jones

Test for Trac #2358

parent 1db5bb2f
{-# OPTIONS_GHC -fth #-}
-- Trac #2358
module ShouldFail where
import Language.Haskell.TH
x = $(sigE [|1|] (tupleT 1 `appT` conT ''Int))
-- 1 :: (Int) ( a 1-tuple type)
y = $(sigE [|1|] (tupleT 1))
-- 1 :: (1) (a 1-tuple tycon not applied)
z = $(tupE [ [| "yes" |] ])
-- ("yes") (a 1-tuple expression)
TH_1tuple.hs:11:6:
Illegal 1-tuple type constructor
When splicing generated code into the program
When converting TH expression SigE (LitE (IntegerL 1)) (TupleT 1)
In the expression: $(sigE [| 1 |] (tupleT 1))
In the definition of `y': y = $(sigE [| 1 |] (tupleT 1))
...@@ -8,6 +8,7 @@ setTestOpts(only_compiler_types(['ghc'])) ...@@ -8,6 +8,7 @@ setTestOpts(only_compiler_types(['ghc']))
setTestOpts(only_ways(['normal','ghci'])) setTestOpts(only_ways(['normal','ghci']))
test('TH_mkName', normal, compile, ['-v0']) test('TH_mkName', normal, compile, ['-v0'])
test('TH_1tuple', normal, compile_fail, ['-v0'])
test('TH_repE1', normal, compile, ['']) test('TH_repE1', normal, compile, [''])
test('TH_repE2', normal, compile_and_run, ['']) test('TH_repE2', normal, compile_and_run, [''])
......
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