Commit 6fcd8891 authored by Simon Peyton Jones's avatar Simon Peyton Jones

Test Trac #3177

parent 9a7d7300
{- LANGUAGE TemplateHaskell #-}
-- Template Haskell type splices
module T3177 where
f :: $(id [t| Int |])
f = 3
class C a where
op :: a -> a
instance C a => C ($([t| Maybe |]) a) where
op x = fmap op x
{- LANGUAGE TemplateHaskell #-}
-- Template Haskell type splices
-- Should fail, with a decent error message
module T3177a where
f :: $(id [t| Int Int |])
f = 3
g :: Int Int
g = 3
T3177a.hs:8:14:
`Int' is applied to too many type arguments
In the Template Haskell quotation [t| Int Int |]
In the first argument of `id', namely `[t| Int Int |]'
In the expression: id [t| Int Int |]
T3177a.hs:11:5:
`Int' is applied to too many type arguments
In the type signature for `g':
g :: Int Int
...@@ -142,4 +142,6 @@ test('TH_pragma', ...@@ -142,4 +142,6 @@ test('TH_pragma',
if_compiler_lt('ghc', '6.11', expect_fail), if_compiler_lt('ghc', '6.11', expect_fail),
compile, compile,
['-v0 -ddump-splices -dsuppress-uniques -S']) ['-v0 -ddump-splices -dsuppress-uniques -S'])
test('T3177', normal, compile, ['-v0'])
test('T3177a', 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