Commit b088f0fb authored by Simon Peyton Jones's avatar Simon Peyton Jones

Test Trac #3600

parent 9c1047ab
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -ddump-splices #-}
module T3600 where
import T3600a
$(test)
T3600.hs:1:0:
T3600.hs:1:0: Splicing declarations
test
======>
T3600.hs:5:2-5
myFunction[a167] = (testFun1 [], testFun2 [], testFun2 "x")
{-# LANGUAGE TemplateHaskell #-}
module T3600a where
import Language.Haskell.TH
test :: Q [Dec]
test = do
let args1 = [] :: [String]
args2 = [] :: String
args3 = "x" :: String
body = [| (testFun1 args1, testFun2 args2, testFun2 args3) |]
decNm <- newName "myFunction"
(:[]) `fmap` funD decNm [clause [] (normalB body) []]
testFun1 :: [String] -> String
testFun1 _ = "hello"
testFun2 :: String -> String
testFun2 _ = "goodbye"
......@@ -155,3 +155,5 @@ test('T3395', normal, compile_fail, ['-v0'])
test('T3467', normal, compile, [''])
test('T3572', normal, compile_and_run, [''])
test('T3600', extra_clean(['T3600a.hi','T3600a.o']),
multimod_compile, ['T3600','-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